-
Notifications
You must be signed in to change notification settings - Fork 21
84 lines (71 loc) · 2.11 KB
/
check.yaml
File metadata and controls
84 lines (71 loc) · 2.11 KB
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
74
75
76
77
78
79
80
81
82
83
84
name: Check
on:
workflow_dispatch:
pull_request:
branches: [main]
push:
branches: [main]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
check:
name: Check
runs-on: ubuntu-latest
outputs:
go-test-modules: ${{ steps.go-test-modules.outputs.value }}
go-test-upload: ${{ steps.go-test-upload.outcome }}
steps:
- uses: actions/checkout@v4
- name: Setup runner environment
uses: ./.github/actions/setup
- name: Lint
run: task lint
- id: test
name: Test
run: task test:ci
- id: go-test-modules
name: Find modules with Go test results
if: steps.test.outcome == 'success' || steps.test.outcome == 'failure'
run: |
shopt -s nullglob
jq --null-input --raw-output \
'$ARGS.positional
| map(capture("(?<_>.*)\/dist")._) as $mods
| ["value=\($mods)", "length=\($mods | length)"]
| join("\n")' \
--args */*/dist/go-test.json | tee $GITHUB_OUTPUT
- id: go-test-upload
name: Upload Go test results
uses: actions/upload-artifact@v4
if: steps.go-test-modules.outputs.length > 0
with:
name: go-test
path: '*/*/dist/go-test.json'
retention-days: 1
cli-integration:
name: CLI Integration Tests
runs-on: ubuntu-latest
needs: check
steps:
- uses: actions/checkout@v4
- name: Setup runner environment
uses: ./.github/actions/setup
- name: Run CLI integration tests
run: pnpm nx run cli:test:integration
go-test-summary:
name: Test
runs-on: ubuntu-latest
needs: check
if: needs.check.outputs.go-test-upload == 'success'
strategy:
matrix:
value: ${{ fromJSON(needs.check.outputs.go-test-modules) }}
steps:
- uses: actions/download-artifact@v4
with:
name: go-test
- uses: robherley/go-test-action@v0
with:
moduleDirectory: ${{ matrix.value }}
fromJSONFile: ${{ matrix.value }}/dist/go-test.json