Skip to content

chore(readme and pkg indexing): update readme, add command to makefile to index on golang.org after pushing a new version, update license in goreleaser.yml, and i forgot to mention that i build .deb and .rpm too #200

chore(readme and pkg indexing): update readme, add command to makefile to index on golang.org after pushing a new version, update license in goreleaser.yml, and i forgot to mention that i build .deb and .rpm too

chore(readme and pkg indexing): update readme, add command to makefile to index on golang.org after pushing a new version, update license in goreleaser.yml, and i forgot to mention that i build .deb and .rpm too #200

Workflow file for this run

name: verify
on:
push:
branches: [ "main", "master" ]
pull_request:
branches: [ "main", "master" ]
jobs:
path-filter:
name: Check Changed Paths
runs-on: ubuntu-latest
outputs:
code: ${{ steps.filter.outputs.code }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
code:
- 'generator/**'
- 'cli/**'
- 'schema/**'
- 'integration/**'
- 'dbProviders/**'
- 'migration/**'
- 'benchmark/**'
- '*.go'
- 'go.mod'
- 'go.sum'
- '.github/workflows/**'
compiler-unit-tests:
needs: path-filter
if: ${{ needs.path-filter.outputs.code == 'true' }}
name: Unit Tests (${{ matrix.os }})
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
cache: true
- name: Run compiler unit tests
run: go test -race -v ./...
integration-tests:
needs: path-filter
if: ${{ needs.path-filter.outputs.code == 'true' }}
name: Run Database Integration Tests
runs-on: ubuntu-latest
services:
postgres:
image: postgres:16-alpine
env:
POSTGRES_USER: testuser
POSTGRES_PASSWORD: testpassword
POSTGRES_DB: phi_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
- name: Generate integration client
run: make integration-gen
- name: Run Formatter Check
run: make fmt-check
- name: Run Tidy Check
run: make tidy-check
- name: Vet packages
run: make vet
- name: Run SQLite Integration Tests
run: |
cp integration/schema.prisma integration/schema.prisma.bak
node integration/prepareSchema.js sqlite
rm -f integration/phi/migrations/*.sql
make integration-gen
cd integration
../bin/phi migrate -u "file:dev.db" init_sqlite
go test -race -tags sqlite -v ./...
mv schema.prisma.bak schema.prisma
- name: Run Postgres Integration Tests
run: |
PG_URL="${{ secrets.PG_DATABASE_URL }}"
if [ -z "$PG_URL" ]; then
PG_URL="postgres://testuser:testpassword@localhost:5432/phi_test?sslmode=disable"
else
PG_URL="${PG_URL/valkyrie_test/phi_test}"
PG_URL="${PG_URL/valk_test/phi_test}"
fi
cp integration/schema.prisma integration/schema.prisma.bak
node integration/prepareSchema.js postgres
rm -f integration/phi/migrations/*.sql
make integration-gen
cd integration
../bin/phi migrate -u "$PG_URL" init_pg
PG_DATABASE_URL="$PG_URL" go test -race -v ./...
mv schema.prisma.bak schema.prisma