-
Notifications
You must be signed in to change notification settings - Fork 4
208 lines (201 loc) · 6.02 KB
/
build.yaml
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
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
# GitHub Actions workflow file.
#
# For more information, visit
# https://docs.github.com/actions/learn-github-actions.
---
name: build
# Makes workflow run on any push or pull request.
on:
pull_request:
branches:
- "**"
push:
branches:
- "**"
workflow_dispatch:
inputs:
debug:
default: false
description: Use Tmate session for debugging
type: boolean
job:
default: test
description: CI job to run
options:
- documenation
- lint
- posix
- powershell
type: choice
env:
NPM_CONFIG_CACHE: "${{ github.workspace }}/.cache/npm"
PIP_CACHE_DIR: "${{ github.workspace }}/.cache/pip"
PIP_DISABLE_PIP_VERSION_CHECK: "true"
PIP_ROOT_USER_ACTION: ignore
POETRY_CACHE_DIR: "${{ github.workspace }}/.cache/pypoetry"
POETRY_VIRTUALENVS_IN_PROJECT: "true"
PYTHON_KEYRING_BACKEND: "keyring.backends.null.Keyring"
jobs:
documenation:
if: >-
${{ github.event_name != 'workflow_dispatch' || inputs.job ==
'documentation' }}
name: Build documentation
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Cache packages
uses: actions/cache@v4
with:
path: |
.cache
.venv
node_modules
key: >-
node-22_python-3.12_${{ runner.os }}_npm-${{
hashFiles('package-lock.json') }}_poetry-${{
hashFiles('poetry.lock') }}
- name: Install Just
run: >-
curl -LSfs https://just.systems/install.sh | sh -s -- --to
/usr/local/bin
- name: Install Node interpreter
uses: actions/setup-node@v4
with:
node-version: "22"
- name: Install Python interpreter
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install development dependencies
run: just setup
- name: Build documentation
run: just docs
- name: Setup Tmate session if debug enabled
if: >-
${{ always() && github.event_name == 'workflow_dispatch' &&
inputs.debug }}
timeout-minutes: 60
uses: mxschmitt/action-tmate@v3
lint:
if: ${{ github.event_name != 'workflow_dispatch' || inputs.job == 'lint' }}
name: Check code with formatter and linter
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Cache packages
uses: actions/cache@v4
with:
path: |
.cache
.venv
node_modules
key: >-
node-22_python-3.12_${{ runner.os }}_npm-${{
hashFiles('package-lock.json') }}_poetry-${{
hashFiles('poetry.lock') }}
- name: Install Just
run: >-
curl -LSfs https://just.systems/install.sh | sh -s -- --to
/usr/local/bin
- name: Install Node interpreter
uses: actions/setup-node@v4
with:
node-version: "22"
- name: Install Python interpreter
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install development dependencies
run: just setup
- name: Check code formatting
run: just format
- name: Run code analyses
run: just lint
- name: Setup Tmate session if debug enabled
if: >-
${{ always() && github.event_name == 'workflow_dispatch' &&
inputs.debug }}
timeout-minutes: 60
uses: mxschmitt/action-tmate@v3
posix:
if: >-
${{ github.event_name != 'workflow_dispatch' || inputs.job == 'posix' }}
name: Run unit tests for POSIX scripts
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Cache packages
uses: actions/cache@v4
with:
path: |
.cache
.venv
node_modules
key: >-
node-22_python-3.12_${{ runner.os }}_npm-${{
hashFiles('package-lock.json') }}_poetry-${{
hashFiles('poetry.lock') }}
- name: Install Just
run: >-
curl -LSfs https://just.systems/install.sh | sh -s -- --to
/usr/local/bin
- name: Install Node interpreter
uses: actions/setup-node@v4
with:
node-version: "22"
- name: Install Python interpreter
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install development dependencies
run: just setup
- name: Build test suites
run: just test
- name: Setup Tmate session if debug enabled
if: >-
${{ always() && github.event_name == 'workflow_dispatch' &&
inputs.debug }}
timeout-minutes: 60
uses: mxschmitt/action-tmate@v3
powershell:
if: >-
${{ github.event_name != 'workflow_dispatch' || inputs.job == 'powershell'
}}
name: Run linter and unit tests for PowerShell scripts
runs-on: windows-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Cache packages
uses: actions/cache@v4
with:
path: |
.cache
node_modules
key: >-
node-22_${{ runner.os }}_npm-${{ hashFiles('package-lock.json') }}
- name: Install Just for Windows
run: choco install --yes just
- name: Install Node interpreter
uses: actions/setup-node@v4
with:
node-version: "22"
- name: Install development dependencies
run: just setup
shell: powershell
- name: Check code formatting
run: just format
- name: Run code analyses
run: just lint
- name: Run test suites
run: just test
- name: Setup Tmate session if debug enabled
if: >-
${{ always() && github.event_name == 'workflow_dispatch' &&
inputs.debug }}
timeout-minutes: 60
uses: mxschmitt/action-tmate@v3