generated from cheqd/.github
-
Notifications
You must be signed in to change notification settings - Fork 5
73 lines (57 loc) · 1.93 KB
/
test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
name: "Build & Test"
on:
workflow_call:
defaults:
run:
shell: bash
jobs:
unit-tests:
name: "Unit Tests"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: ./go.mod
cache: true
- name: Install ginkgo
run: |
go install github.com/onsi/ginkgo/v2/ginkgo@latest
- name: Run Golang unit tests
working-directory: ./tests/unit/
run: ginkgo -r --tags unit --race --randomize-all --randomize-suites --keep-going --trace
integration-tests:
name: "Integration Tests"
runs-on: ubuntu-latest
env:
IMAGE_NAME: ${{ github.repository }}
steps:
- uses: actions/checkout@v4
- name: Download Docker image
uses: actions/download-artifact@v4
with:
name: did-resolver-staging
- name: Load Docker image
run: docker image load --input did-resolver-staging.tar
- name: Set up Docker container for test
run: docker compose -f tests/docker-compose-testing.yml up --detach --no-build
- uses: actions/setup-go@v5
with:
go-version-file: ./go.mod
cache: true
- name: Install ginkgo
working-directory: ./..
run: go install github.com/onsi/ginkgo/v2/ginkgo@latest
- name: Run Ginkgo integration tests
working-directory: ./tests/integration/rest
run: |
ginkgo -r --tags integration --race --randomize-suites --keep-going --trace --junit-report ./report-integration.xml
- name: Show logs
if: failure()
working-directory: ./docker/localnet
run: docker compose -f tests/docker-compose-testing.yml logs --tail --follow
- name: Upload integration tests result
uses: actions/upload-artifact@v4
with:
name: report-integration.xml
path: tests/integration/rest/report-integration.xml