Merge pull request #21 from VoidClancy/rename-to-valk #29
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: verify | |
| on: | |
| push: | |
| branches: [ "main", "master" ] | |
| pull_request: | |
| branches: [ "main", "master" ] | |
| jobs: | |
| integration-tests: | |
| name: Run Integration Tests | |
| runs-on: ubuntu-latest | |
| services: | |
| postgres: | |
| image: postgres:16-alpine | |
| env: | |
| POSTGRES_USER: testuser | |
| POSTGRES_PASSWORD: testpassword | |
| POSTGRES_DB: valk_test | |
| ports: | |
| - 5432:5432 | |
| options: >- | |
| --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version-file: 'go.mod' | |
| cache: true | |
| cache-dependency-path: '**/go.sum' | |
| - name: Vet packages | |
| run: make vet | |
| - name: Run compiler unit tests | |
| run: make test | |
| - name: Run SQLite Integration Tests | |
| run: make integration-test | |
| - name: Run Postgres Integration Tests | |
| run: | | |
| PG_URL="${{ secrets.PG_DATABASE_URL }}" | |
| if [ -z "$PG_URL" ]; then | |
| PG_URL="postgres://testuser:testpassword@localhost:5432/valk_test?sslmode=disable" | |
| else | |
| PG_URL="${PG_URL/valkyrie_test/valk_test}" | |
| fi | |
| sed -i 's/provider = "sqlite"/provider = "postgres"/' integration/schema.prisma | |
| rm -f integration/valk/migrations/*.sql | |
| make integration-gen | |
| cd integration | |
| ../bin/valk migrate -u "$PG_URL" init_pg | |
| PG_DATABASE_URL="$PG_URL" go test -v ./... |