21
21
name : Integration Tests
22
22
needs : ['config']
23
23
runs-on : ubuntu-latest
24
- container : quay.io/projectquay/golang:${{ matrix.go }}
25
24
env :
26
25
POSTGRES_CONNECTION_STRING : " host=clair-db port=5432 user=clair dbname=clair sslmode=disable"
27
26
RABBITMQ_CONNECTION_STRING : " amqp://guest:guest@clair-rabbitmq:5672/"
39
38
--health-timeout 5s
40
39
--health-retries 5
41
40
clair-rabbitmq :
42
- image : rabbitmq:3.8.5
41
+ image : docker.io/library/ rabbitmq:3.8.5
43
42
env :
44
43
RABBITMQ_VM_MEMORY_HIGH_WATERMARK : " 85%"
45
44
clair-activemq :
@@ -49,28 +48,42 @@ jobs:
49
48
matrix :
50
49
go : ${{ fromJSON(needs.config.outputs.go_versions) }}
51
50
# Put non-amd64 platforms that should run tests here:
52
- platform : ['linux/ arm64', 'linux/ ppc64le', 'linux/ s390x']
51
+ platform : ['arm64', 'ppc64le', 's390x']
53
52
steps :
54
53
- uses : actions/checkout@v3
55
- - uses : ./.github/actions/go-cache
54
+ - uses : actions/cache@v3
55
+ id : cache
56
56
with :
57
- go : ${{ matrix.go }}
57
+ path : |
58
+ ~/.cache/go-build
59
+ ~/go/pkg/mod
60
+ key : ${{ runner.os }}-${{ matrix.platform }}-${{ matrix.go }}-${{ hashFiles('**/go.sum') }}
61
+ restore-keys : |
62
+ ${{ runner.os }}-${{ matrix.platform }}-${{ matrix.go }}-
58
63
- name : Set up QEMU
59
64
uses : docker/setup-qemu-action@v2
60
65
with :
61
- platforms : ${{ matrix.platform }}
62
- - run : >-
66
+ platforms : linux/${{ matrix.platform }}
67
+ - name : Make directories on cache miss
68
+ run : mkdir -p "$(go env GOMODCACHE)" "$(go env GOCACHE)"
69
+ if : ${{ ! steps.cache.outputs.cache-hit }}
70
+ - name : Run integration tests
71
+ run : >-
63
72
docker run
64
73
--rm
65
- --platform ${{ matrix.platform }}
74
+ --network ${{ job.container.network }}
75
+ --platform linux/${{ matrix.platform }}
66
76
--mount "type=bind,src=$(go env GOMODCACHE),dst=/go/pkg/mod"
77
+ --mount "type=bind,src=$(go env GOCACHE),dst=/root/.cache/go-build"
67
78
--mount "type=bind,src=$(pwd),dst=/build"
79
+ --env POSTGRES_CONNECTION_STRING
80
+ --env RABBITMQ_CONNECTION_STRING
81
+ --env STOMP_CONNECTION_STRING
68
82
-w /build
69
83
quay.io/projectquay/golang:${{ matrix.go }}
70
84
go test
71
85
-tags integration
72
- github.com/quay/claircore/...
73
- ./...
86
+ $(go list -m github.com/quay/clair{core,}/... | awk '{printf("%s/... ",$1)}')
74
87
- uses : actions/upload-artifact@v3
75
88
if : failure()
76
89
with :
0 commit comments