-
Notifications
You must be signed in to change notification settings - Fork 551
71 lines (64 loc) · 1.78 KB
/
test-integration.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
name: Integration
on:
pull_request:
push:
branches:
- main
- release/*
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
pre-test:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v4
- name: Finding files and store to output
id: set-matrix
run: echo "matrix=$({ cd integration && find . -type d ! -name testdata -maxdepth 1 -print; } | tail -n +2 | cut -c 3- | jq -R . | jq -cs .)" >> $GITHUB_OUTPUT
integration:
name: test ${{ matrix.test-path }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
needs: pre-test
if: fromJSON(needs.pre-test.outputs.matrix)[0] != null
continue-on-error: true
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
test-path: ${{fromJson(needs.pre-test.outputs.matrix)}}
steps:
- uses: actions/checkout@v4
- uses: technote-space/[email protected]
with:
PATTERNS: |
**/*.go
**/*.plush
**/*.tpl
go.mod
go.sum
**/testdata/**
- uses: actions/setup-go@v5
if: env.GIT_DIFF
with:
go-version: "stable"
- name: Run Integration Tests
if: env.GIT_DIFF
env:
GOTOOLCHAIN: local+path
GOSUMDB: off
run: go test -v -timeout 120m ./integration/${{ matrix.test-path }}
status:
runs-on: ubuntu-latest
needs: integration
if: always()
steps:
- name: Update result status
run: |
if [ "${{ needs.integration.result }}" = "failure" ]; then
exit 1
else
exit 0
fi