Fix incorrect encounters in Gen IV games #691
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: Database | |
| on: | |
| pull_request: | |
| jobs: | |
| csv: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Lint | |
| run: | | |
| set -e | |
| curl -sSL https://github.com/Clever/csvlint/releases/download/v0.3.0/csvlint-v0.3.0-linux-amd64.tar.gz | tar xz --strip-components=1 | |
| for filename in data/v2/csv/*.csv; do | |
| echo "$filename" | |
| ./csvlint -lazyquotes "$filename" # TODO: remove lazyquotes when https://github.com/Clever/csvlint/issues/45 will be addressed | |
| done | |
| openapi: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Setup uv | |
| uses: ./.github/actions/setup-uv | |
| - name: Generate OpenAPI schema | |
| run: | | |
| make install-base | |
| make openapi-generate | |
| sqlite: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| with: | |
| submodules: recursive | |
| - name: Setup uv | |
| uses: ./.github/actions/setup-uv | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Start pokeapi | |
| run: | | |
| make install-base | |
| make setup | |
| make build-db | |
| nohup make serve & | |
| sleep 3 | |
| - name: Dump DB | |
| run: stat db.sqlite3 | |
| - name: Test data | |
| run: curl -Ss http://localhost:8000/api/v2/pokemon/1/ | grep -q 'bulbasaur' | |
| postgres: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| with: | |
| submodules: recursive | |
| - name: Build and start services | |
| run: | | |
| docker compose -f docker-compose.yml -f docker-compose-dev.yml up -d --build | |
| - name: Run migrations and build database | |
| run: | | |
| make docker-migrate | |
| make docker-build-db | |
| - name: Dump DB | |
| run: docker compose exec -T db pg_dump -U ash -Fc -N 'hdb_*' pokeapi > pokeapi.dump | |
| - name: Drop and recreate database | |
| run: | | |
| docker compose exec -T db psql -U ash -d postgres -c "DROP DATABASE pokeapi WITH (FORCE);" | |
| docker compose exec -T db psql -U ash -d postgres -c "CREATE DATABASE pokeapi;" | |
| - name: Import database | |
| run: docker compose exec -T db pg_restore -U ash -d pokeapi < pokeapi.dump | |
| - name: Test data | |
| run: curl -Ss http://localhost/api/v2/pokemon/1/ | grep -q 'bulbasaur' |