Add user rights web tool #137
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Tests | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| services: | |
| postgres: | |
| image: postgres:16 | |
| ports: | |
| - 5432:5432 | |
| env: | |
| POSTGRES_USER: postgres | |
| POSTGRES_PASSWORD: postgres | |
| options: >- | |
| --health-cmd "pg_isready -U postgres" | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22.x | |
| cache: npm | |
| - name: Install PostgreSQL client tools | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y postgresql-client | |
| - name: Prepare PostgreSQL database | |
| env: | |
| PGPASSWORD: postgres | |
| run: | | |
| until pg_isready -h localhost -U postgres; do sleep 1; done | |
| psql -h localhost -U postgres -c "DROP ROLE IF EXISTS agpwiki_user;" | |
| psql -h localhost -U postgres -c "DROP DATABASE IF EXISTS agpwiki_test WITH (FORCE);" | |
| psql -h localhost -U postgres -c "CREATE ROLE agpwiki_user LOGIN PASSWORD 'agpwiki_password';" | |
| psql -h localhost -U postgres -c "CREATE DATABASE agpwiki_test OWNER agpwiki_user;" | |
| psql -h localhost -U postgres -d agpwiki_test -c "CREATE EXTENSION IF NOT EXISTS \"pgcrypto\";" | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Run tests | |
| run: npm test |