-
Notifications
You must be signed in to change notification settings - Fork 0
123 lines (109 loc) · 3.11 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
---
name: CI
on:
workflow_call:
inputs:
deploy-docs:
required: false
type: boolean
default: false
release:
required: false
type: boolean
default: false
version:
required: false
type: string
jobs:
get-changed-files:
name: Get Changed Files
uses: ./.github/workflows/get-changed-files.yml
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 }}
tests:
name: Tests
needs:
- pre-commit
- get-changed-files
if: github.event_name != 'pull_request' || fromJSON(needs.get-changed-files.outputs.changed-files)['needs_tests'] == 'true'
uses: ./.github/workflows/test-action.yml
docs:
name: Docs
needs:
- pre-commit
- get-changed-files
if: github.event_name != 'pull_request' || fromJSON(needs.get-changed-files.outputs.changed-files)['docs'] == 'true'
uses: ./.github/workflows/docs-action.yml
deploy-docs:
name: Deploy Docs
uses: ./.github/workflows/deploy-docs-action.yml
# Only build doc deployments from the default branch of the repo and never for PRs.
if: >-
github.event_name != 'pull_request' &&
inputs.deploy-docs &&
(
github.event_name == 'tag' ||
github.ref == format('refs/heads/{0}', github.event.repository.default_branch)
)
needs:
- docs
- tests
build-python-package:
name: Python Package
if: ${{ inputs.release && success() }}
uses: ./.github/workflows/package-action.yml
needs:
- pre-commit
with:
version: "${{ inputs.version }}"
deploy-python-package:
name: Deploy Python Package (PyPI)
uses: ./.github/workflows/deploy-package-action.yml
if: ${{ inputs.release && success() }}
needs:
- tests
- docs
- build-python-package
with:
test: false
version: "${{ inputs.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-24.04
if: always()
needs:
- tests
- docs
- deploy-docs
- build-python-package
- deploy-python-package
steps:
- name: Download Exit Status Files
if: always()
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
path: exitstatus
pattern: exitstatus-*
merge-multiple: true
- name: Delete Exit Status Artifacts
if: always()
uses: geekyeggo/delete-artifact@7ee91e82b4a7f3339cd8b14beace3d826a2aac39 # v5.1.0
with:
name: exitstatus-*
useGlob: true
failOnError: false
- name: Set Pipeline Exit Status
run: |
tree exitstatus
grep -RE 'failure|cancelled' exitstatus/ && exit 1 || exit 0
- name: Done
if: always()
run:
echo "All workflows finished"