forked from saltstack/relenv
-
Notifications
You must be signed in to change notification settings - Fork 0
183 lines (166 loc) · 4.81 KB
/
ci.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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
name: CI
concurrency:
# Concurrency is defined in a way that concurrent builds against branches do
# not cancel previous builds.
# However, for every new build against the same pull request source branch,
# all older builds against that same branch get canceled.
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.repository }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
on:
workflow_call:
inputs:
kind:
required: false
type: string
default: dev
package_command:
required: false
type: string
description: Command used to build python package
default: >-
python -m
build
-C--global-option=egg_info
-C--global-option=--tag-build=+dev$(git rev-parse --short HEAD)
--wheel
--outdir dist/
jobs:
get-changed-files:
name: Get Changed Files
runs-on: ubuntu-latest
permissions:
contents: read # for dorny/paths-filter to fetch a list of changed files
pull-requests: read # for dorny/paths-filter to read pull requests
outputs:
changed-files: ${{ toJSON(steps.changed-files.outputs) }}
steps:
- uses: actions/checkout@v3
- name: Get Changed Files
id: changed-files
uses: dorny/paths-filter@v2
with:
token: ${{ github.token }}
list-files: json
filters: |
repo:
- added|modified:
- '**'
deleted:
- deleted:
- '**'
toolchain:
- added|modified:
- '.github/workflows/*toolchain*.yml'
- 'relenv/toolchain.py'
- 'relenv/_toolchain/**'
pre-commit:
name: Pre-Commit
uses: ./.github/workflows/pre-commit-action.yml
needs:
- get-changed-files
with:
changed-files: ${{ needs.get-changed-files.outputs.changed-files }}
build-python-package:
name: Python Package
uses: ./.github/workflows/package-action.yml
if: always()
needs:
- pre-commit
with:
kind: "${{ inputs.kind }}"
cmd: "${{ inputs.package_command }}"
toolchain:
name: Toolchain Builds
uses: ./.github/workflows/toolchain-action.yml
needs:
- get-changed-files
with:
changed-files: ${{ needs.get-changed-files.outputs.changed-files }}
build-native:
name: Python Native Builds
uses: ./.github/workflows/build-native-action.yml
needs:
- get-changed-files
- toolchain
with:
changed-files: ${{ needs.get-changed-files.outputs.changed-files }}
test-fips:
name: Test Fips Mode
needs:
- build-native
- get-changed-files
uses: ./.github/workflows/test-fips-action.yml
#build-cross:
# name: Python Cross Builds
# uses: ./.github/workflows/build-action.yml
# needs:
# - get-changed-files
# - toolchain
# - build-native
# with:
# changed-files: ${{ needs.get-changed-files.outputs.changed-files }}
# kind: "cross"
test:
name: Test
needs:
- get-changed-files
uses: ./.github/workflows/test-action.yml
with:
changed-files: ${{ needs.get-changed-files.outputs.changed-files }}
docs:
name: Docs
needs:
- get-changed-files
uses: ./.github/workflows/docs-action.yml
with:
changed-files: ${{ needs.get-changed-files.outputs.changed-files }}
deploy-python-package:
name: Deploy Python Package
uses: ./.github/workflows/deploy-package-action.yml
if: ${{ inputs.kind == 'release' && success() }}
needs:
- pre-commit
- test
- docs
- build-python-package
- test-fips
create-release:
name: Create Github Release
uses: ./.github/workflows/github-release.yml
if: ${{ inputs.kind == 'release' && success() }}
needs:
- build-python-package
- deploy-python-package
with:
version: ${{ needs.build-python-package.outputs.version }}
set-pipeline-exit-status:
# This step is just so we can make github require this step, to pass checks
# on a pull request instead of requiring all
name: Set the CI Pipeline Exit Status
runs-on: ubuntu-latest
if: always()
needs:
- pre-commit
- toolchain
- build-native
#- build-cross
- test
- docs
- deploy-python-package
- create-release
steps:
- name: Get workflow information
id: get-workflow-info
uses: technote-space/workflow-conclusion-action@v3
- name: Set Pipeline Exit Status
shell: bash
run: |
if [ "${{ steps.get-workflow-info.outputs.conclusion }}" != "success" ]; then
exit 1
else
exit 0
fi
- name: Done
if: always()
run:
echo "All workflows finished"