-
-
Notifications
You must be signed in to change notification settings - Fork 0
86 lines (74 loc) · 2.14 KB
/
test.yml
File metadata and controls
86 lines (74 loc) · 2.14 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
name: Test
on:
workflow_dispatch:
pull_request:
branches:
- main
push:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref_name }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
permissions:
contents: read
env:
GOEXPERIMENT: jsonv2
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version-file: 'go.mod'
- run: go test -count=1 -race -shuffle=on -coverprofile=coverage.out -covermode=atomic ./...
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: coverage
path: coverage.out
if-no-files-found: error
e2e:
needs: test
uses: ./.github/workflows/test-e2e.yml
with:
url: '' # Leave blank to boot a local server for testing
codecov:
needs: test
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: coverage
- uses: codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 # v6.0.0
with:
use_oidc: true
fail_ci_if_error: true
disable_search: true
files: coverage.out
dispatch:
if: github.event_name == 'push' && github.ref_name == 'main'
needs:
- test
- e2e
permissions:
actions: write
runs-on: ubuntu-24.04
steps:
- name: Dispatch Publish Workflow
run: |
gh workflow run publish.yml \
--repo "${REPO}" \
--ref "${REF}"
env:
REPO: ${{ github.repository }}
REF: ${{ github.ref_name }}
GH_TOKEN: ${{ github.token }}