| 1 |
name: Test |
| 2 |
|
| 3 |
on: |
| 4 |
push: |
| 5 |
branches: |
| 6 |
- main |
| 7 |
pull_request: |
| 8 |
branches: |
| 9 |
- '**' |
| 10 |
|
| 11 |
permissions: |
| 12 |
contents: read |
| 13 |
|
| 14 |
jobs: |
| 15 |
integration-tests: |
| 16 |
strategy: |
| 17 |
matrix: |
| 18 |
containerGoVer: |
| 19 |
- "1.21" |
| 20 |
- "1.22" |
| 21 |
runs-on: ubuntu-latest |
| 22 |
container: golang:${{ matrix.containerGoVer }} |
| 23 |
services: |
| 24 |
postgres: |
| 25 |
image: postgres |
| 26 |
env: |
| 27 |
POSTGRES_DB: gorptest |
| 28 |
POSTGRES_USER: gorptest |
| 29 |
POSTGRES_PASSWORD: gorptest |
| 30 |
options: >- |
| 31 |
--health-cmd pg_isready |
| 32 |
--health-interval 10s |
| 33 |
--health-timeout 5s |
| 34 |
--health-retries 10 |
| 35 |
|
| 36 |
mysql: |
| 37 |
image: mariadb:10.5 |
| 38 |
env: |
| 39 |
MYSQL_DATABASE: gorptest |
| 40 |
MYSQL_USER: gorptest |
| 41 |
MYSQL_PASSWORD: gorptest |
| 42 |
MYSQL_RANDOM_ROOT_PASSWORD: true |
| 43 |
options: >- |
| 44 |
--health-cmd "mysqladmin ping" |
| 45 |
--health-interval 10s |
| 46 |
--health-timeout 5s |
| 47 |
--health-retries 10 |
| 48 |
steps: |
| 49 |
- uses: actions/checkout@v3 |
| 50 |
with: |
| 51 |
persist-credentials: false |
| 52 |
|
| 53 |
- name: Integration Tests |
| 54 |
run: ./test_all.sh |
| 55 |
|
| 56 |
quick-tests: |
| 57 |
strategy: |
| 58 |
matrix: |
| 59 |
containerGoVer: |
| 60 |
- "1.21" |
| 61 |
- "1.22" |
| 62 |
runs-on: ubuntu-latest |
| 63 |
container: golang:${{ matrix.containerGoVer }} |
| 64 |
steps: |
| 65 |
- uses: actions/checkout@v3 |
| 66 |
with: |
| 67 |
persist-credentials: false |
| 68 |
|
| 69 |
- name: Go Build |
| 70 |
run: go build -v ./... |
| 71 |
|
| 72 |
- name: Unit Tests |
| 73 |
run: go test -v ./... |
| 74 |
|
| 75 |
govulncheck: |
| 76 |
strategy: |
| 77 |
matrix: |
| 78 |
containerGoVer: |
| 79 |
- "latest" |
| 80 |
runs-on: ubuntu-latest |
| 81 |
container: golang:${{ matrix.containerGoVer }} |
| 82 |
steps: |
| 83 |
- uses: actions/checkout@v3 |
| 84 |
with: |
| 85 |
persist-credentials: false |
| 86 |
|
| 87 |
- name: Run govulncheck |
| 88 |
run: go run golang.org/x/vuln/cmd/govulncheck@latest ./... |