|
10 | 10 |
|
11 | 11 | jobs: |
12 | 12 | quality-check: |
13 | | - runs-on: "ubuntu-latest" |
| 13 | + runs-on: "ubuntu-24.04" |
14 | 14 |
|
15 | 15 | steps: |
16 | | - - uses: "actions/checkout@v4" |
17 | | - - uses: "actions/setup-go@v4" |
| 16 | + - uses: "actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd" # v6.0.2 |
| 17 | + - uses: "actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c" # v6.4.0 |
18 | 18 | with: |
19 | 19 | go-version: "1.25" |
20 | | - - uses: "actions/cache@v3" |
| 20 | + - uses: "actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7" # v5.0.4 |
21 | 21 | with: |
22 | 22 | path: "~/.cache/go-build" |
23 | 23 | key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} |
|
37 | 37 | echo "$diff" |
38 | 38 | exit 1 |
39 | 39 | fi |
| 40 | +
|
| 41 | + test: |
| 42 | + runs-on: "ubuntu-24.04" |
| 43 | + |
| 44 | + services: |
| 45 | + postgres: |
| 46 | + image: "postgres:16" |
| 47 | + env: |
| 48 | + POSTGRES_USER: "postgres" |
| 49 | + POSTGRES_PASSWORD: "postgres" |
| 50 | + ports: |
| 51 | + - "5432:5432" |
| 52 | + options: >- |
| 53 | + --health-cmd pg_isready |
| 54 | + --health-interval 10s |
| 55 | + --health-timeout 5s |
| 56 | + --health-retries 5 |
| 57 | +
|
| 58 | + steps: |
| 59 | + - uses: "actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd" # v6.0.2 |
| 60 | + - uses: "actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c" # v6.4.0 |
| 61 | + with: |
| 62 | + go-version: "1.25" |
| 63 | + - uses: "actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7" # v5.0.4 |
| 64 | + with: |
| 65 | + path: "~/.cache/go-build" |
| 66 | + key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} |
| 67 | + restore-keys: | |
| 68 | + ${{ runner.os }}-go- |
| 69 | + - name: "Setup test database" |
| 70 | + run: | |
| 71 | + PGPASSWORD=postgres psql -h localhost -U postgres <<-EOF |
| 72 | + CREATE USER kit WITH SUPERUSER PASSWORD 'kit'; |
| 73 | + CREATE DATABASE kit_test; |
| 74 | + GRANT ALL PRIVILEGES ON DATABASE kit_test TO kit; |
| 75 | + EOF |
| 76 | + PGPASSWORD=kit psql -h localhost -U kit -d kit_test -c "ALTER SCHEMA public OWNER TO kit;" |
| 77 | + - run: "go test -v -count=1 ./..." |
0 commit comments