-
Notifications
You must be signed in to change notification settings - Fork 0
101 lines (89 loc) · 2.8 KB
/
pipeline-library-go.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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# This workflow is generated and will be automatically synchronized.
# Source: https://github.com/stimtech/infra-workflows/blob/main/pipeline-library-go.yml
name: Pipeline
on:
push:
branches: [main]
pull_request:
jobs:
configuration:
name: Gather configuration
runs-on: ubuntu-latest
timeout-minutes: 5
outputs:
action_config: ${{ steps.action_config.outputs.data }}
steps:
- name: Check out code
uses: actions/checkout@v3
- name: Read STIM action configuration
id: action_config
run: |
if [[ -f ".github/stim-pipeline.json" ]]; then
echo data=$(cat .github/stim-pipeline.json) >> $GITHUB_OUTPUT
else
echo data={} >> $GITHUB_OUTPUT
fi
go-analyze:
name: Analyze Go
needs: configuration
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Check out code
uses: actions/checkout@v3
- name: Check out action
uses: actions/checkout@v3
with:
repository: stimtech/action-go-analyze
ref: 4
path: ./.github/actions/go-analyze
token: ${{ secrets.GH_PAT }}
- name: Analyze Go
uses: ./.github/actions/go-analyze
with:
codacy_token: ${{ secrets.CODACY_PROJECT_TOKEN }}
gh_credentials: ${{ secrets.GIT_CREDENTIALS }}
integration-test:
name: Integration tests
needs: configuration
if: fromJSON(needs.configuration.outputs.action_config).actions.action-go-integration-test.enable
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v3
- name: Check out action
uses: actions/checkout@v3
with:
repository: stimtech/action-go-integration-test
ref: 3
path: ./.github/actions/go-integration-test
token: ${{ secrets.GH_PAT }}
- name: Run integration tests
uses: ./.github/actions/go-integration-test
with:
gh_credentials: ${{ secrets.GIT_CREDENTIALS }}
bitbucket_credentials: ${{ secrets.BITBUCKET_GIT_CREDENTIALS }}
codacy_token: ${{ secrets.CODACY_PROJECT_TOKEN }}
pipeline-complete:
name: Pipeline Complete
needs:
- configuration
- go-analyze
- integration-test
if: always()
runs-on: ubuntu-latest
steps:
- name: Check out action
uses: actions/checkout@v3
with:
repository: stimtech/action-pipeline-complete
ref: 2
path: ./.github/actions/pipeline-complete
token: ${{ secrets.GH_PAT }}
- name: Pipeline Complete
uses: ./.github/actions/pipeline-complete
with:
token: ${{ secrets.GH_PAT }}
secrets: ${{ toJSON(secrets) }}
needs_context: ${{ toJSON(needs) }}
notify: false