Files
OHTU-German-learning-website/.github/workflows/github-actions.yml
T
84da650a8f Emil/db migrations (#58)
* Add users table migration

* Add users table migration and update schema

* Add users table migration

* updated schema, users table and .env.test

* added public.users table

* Add users table migration

* Add users table migration

* more fixing

* prettier, husky and editorconfig

* husky

* update actions

* Move deps

* fixed workflow

* regenerate schema

* fix generated schema

* move to dev dep

---------

Co-authored-by: Visuri Emil A <evisuri@cubbli22-gold.local>
Co-authored-by: DoebelnAtz <axel.ej.adlercreutz@gmail.com>
2025-02-05 16:20:18 +02:00

56 lines
1.7 KiB
YAML

name: Lint, format and test (and deploy)
on:
pull_request:
types: [opened, reopened, synchronize]
push:
branches:
- master
jobs:
lint-format-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Start databases
run: docker compose up -d
- name: Cache Node.js modules
uses: actions/cache@v3
with:
path: ./gradesa/node_modules
key: ${{ runner.os }}-node-${{ hashFiles('./gradesa/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install Node
uses: actions/setup-node@v4
with:
cache-dependency-path: ./gradesa/package-lock.json
node-version: 22.6
cache: "npm"
- name: Install dependencies
run: npm install
- name: Install client dependencies
run: npm install
working-directory: ./gradesa
- name: Format
run: npm run format:check
- name: Download pgmigrate
run: |
wget --quiet https://github.com/peterldowns/pgmigrate/releases/download/v0.1.0%2Bcommit.2f6a72b/pgmigrate-linux-amd64 -O pgmigrate
chmod +x pgmigrate
mkdir -p "$HOME/bin"
mv pgmigrate "$HOME/bin/"
echo "$HOME/bin/" >> $GITHUB_PATH
- name: Run migrations
run: |
npm run db:migrate
- name: Check for no uncommitted changes
run: |
echo "checking for uncommitted changes"
git --no-pager diff
git status
[[ -z $(git status -s) ]] || (exit 1)
- name: Run tests
working-directory: ./gradesa
run: |
npm run test