-
Notifications
You must be signed in to change notification settings - Fork 0
169 lines (147 loc) · 4.65 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
name: continuous integration
on:
push:
branches:
- main
pull_request:
permissions:
id-token: write
contents: write
actions: write
pull-requests: write
pages: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
ci:
name: continuous integration
runs-on: ledgerhq-shared-small
timeout-minutes: 60
steps:
- name: Checkout
timeout-minutes: 10
uses: actions/checkout@v4
with:
submodules: "true"
- name: Check skippable steps
timeout-minutes: 10
id: skip
uses: fkirc/skip-duplicate-actions@v5
with:
cancel_others: true
skip_after_successful_duplicate: true
do_not_skip: '["workflow_dispatch", "schedule"]'
paths_filter: |
project:
paths:
- '*.lock'
- 'pyproject.toml'
ci:
paths:
- '.github/**'
docs:
paths:
- 'docs/**'
sources:
paths:
- 'src/**'
- 'tests/**'
- name: Pull request | Add author
timeout-minutes: 5
if: github.event_name == 'pull_request'
uses: toshimaru/auto-author-assign@v2.1.1
- name: Pull request | Add labels
timeout-minutes: 30
if: github.event_name == 'pull_request'
uses: actions/labeler@v5
- name: Pull request | Enforce labels
timeout-minutes: 5
if: github.event_name == 'pull_request'
uses: mheap/github-action-required-labels@v5
with:
mode: minimum
count: 1
labels: |
documentation
ci
sources
dependencies
add_comment: true
- name: Get API keys
timeout-minutes: 10
shell: bash
run: |
cat << EOF | jq -r 'to_entries[] | select(.key|endswith("_API_KEY")) | "\(.key)=\(.value)"' >> "$GITHUB_ENV"
${{ toJSON(secrets) }}
EOF
- name: Setup pre-commit cache
timeout-minutes: 10
uses: actions/cache@v4
with:
path: ~/.cache/pre-commit
key: pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}
- name: Setup python / PDM
timeout-minutes: 10
uses: ./.github/actions/pdm
- name: Setup Graphviz
timeout-minutes: 10
uses: ts-graphviz/setup-graphviz@v2
- name: Install dependencies
timeout-minutes: 10
run: pdm install --dev --check --frozen-lockfile
env:
FURY_TOKEN: ${{ secrets.PYPI_DEPLOY_TOKEN}}
- name: Lint
timeout-minutes: 10
if: |
!steps.skip.outputs.should_skip ||
!fromJSON(steps.skip.outputs.paths_result).project.should_skip ||
!fromJSON(steps.skip.outputs.paths_result).ci.should_skip ||
!fromJSON(steps.skip.outputs.paths_result).sources.should_skip
run: pdm run lint
env:
PRE_COMMIT_COLOR: always
- name: Test
timeout-minutes: 20
if: |
!steps.skip.outputs.should_skip ||
!fromJSON(steps.skip.outputs.paths_result).project.should_skip ||
!fromJSON(steps.skip.outputs.paths_result).ci.should_skip ||
!fromJSON(steps.skip.outputs.paths_result).sources.should_skip
run: pdm run test
- name: Publish test reports
timeout-minutes: 10
if: ${{ !cancelled() }}
uses: pmeier/pytest-results-action@v0.7.1
with:
path: tests/.tests.xml
title: Test results
summary: true
display-options: fEX
fail-on-empty: false
- name: Setup docs cache
timeout-minutes: 10
if: ${{ !cancelled() }}
uses: actions/cache@v4
with:
path: docs/build
key: docs-cache-${{ hashFiles('docs') }}
- name: Build docs
timeout-minutes: 10
if: ${{ !cancelled() }}
run: pdm run docs
- name: Setup Github Pages
timeout-minutes: 10
if: ${{ !cancelled() && github.event_name == 'push' && github.ref == 'refs/heads/main' }}
uses: actions/configure-pages@v5
- name: Upload docs to Github Pages
timeout-minutes: 10
if: ${{ !cancelled() && github.event_name == 'push' && github.ref == 'refs/heads/main' }}
uses: actions/upload-pages-artifact@v3
with:
path: './docs/build'
- name: Deploy GitHub Pages
timeout-minutes: 10
if: ${{ !cancelled() && github.event_name == 'push' && github.ref == 'refs/heads/main' }}
uses: actions/deploy-pages@v4