-
Notifications
You must be signed in to change notification settings - Fork 15
96 lines (89 loc) · 2.27 KB
/
test.yml
File metadata and controls
96 lines (89 loc) · 2.27 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
85
86
87
88
89
90
91
92
93
94
95
96
name: test
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
on:
push:
branches:
- 'main'
- 'releases/v*'
tags:
- 'v*'
pull_request:
jobs:
prepare-validate:
runs-on: ubuntu-latest
outputs:
targets: ${{ steps.generate.outputs.targets }}
steps:
-
name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
-
name: List targets
id: generate
uses: docker/bake-action/subaction/list-targets@5be5f02ff8819ecd3092ea6b2e6261c31774f2b4 # v6.10.0
with:
target: validate
validate:
runs-on: ubuntu-latest
needs:
- prepare-validate
strategy:
fail-fast: false
matrix:
target: ${{ fromJson(needs.prepare-validate.outputs.targets) }}
steps:
-
name: Validate
uses: docker/bake-action@5be5f02ff8819ecd3092ea6b2e6261c31774f2b4 # v6.10.0
with:
targets: ${{ matrix.target }}
test:
runs-on: ubuntu-latest
steps:
-
name: Test
uses: docker/bake-action@5be5f02ff8819ecd3092ea6b2e6261c31774f2b4 # v6.10.0
with:
targets: test
-
name: Upload coverage
uses: codecov/codecov-action@75cd11691c0faa626561e295848008c8a7dddffe # v5.5.4
with:
files: ./coverage.txt
token: ${{ secrets.CODECOV_TOKEN }}
example:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
-
name: Set up Go
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version: "1.25"
-
name: Download modules
run: |
go mod download
working-directory: ./example
-
name: Run
run: |
go run main.go
working-directory: ./example
-
name: List docs
run: |
tree -nh ./example/docs
-
name: Upload docs
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: example-docs
path: ./example/docs/*
if-no-files-found: error