-
Notifications
You must be signed in to change notification settings - Fork 4
78 lines (64 loc) · 1.93 KB
/
build.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
name: Build
on:
push:
workflow_call:
inputs:
commit: # For release version bump commit
required: false
type: string
environment:
required: false
type: string
prettyfy: # For HTML diff
required: false
type: boolean
skip_lints_tests:
required: false
type: boolean
sphinx_github_branch: # For HTML diff and production (tag vs branch)
required: false
type: string
jobs:
Build:
runs-on: ubuntu-latest
environment: "${{ inputs.environment }}" # Note: can be empty
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: "${{ inputs.commit }}"
- name: Setup Dependencies
uses: ./.github/actions/deps
- name: Run Tests
if: '! inputs.skip_lints_tests'
env:
PY_COLORS: 1
run: make test
- name: Run Lints
if: '! inputs.skip_lints_tests'
run: make lint
- name: Run Integration Tests
if: '! inputs.skip_lints_tests'
run: make it
- name: Build
env: # Note: these can be empty
SPHINX_GITHUB_BRANCH: "${{ inputs.sphinx_github_branch }}"
SPHINX_HTML_BASEURL: "${{ vars.SPHINX_HTML_BASEURL }}"
run: make docs
- name: Copy .gitignore into html output directory # For diff storage branch
run: cp --no-clobber --verbose .gitignore docs/_build/html/
- name: Prettify
if: inputs.prettyfy
run: |
PS4="\n\033[1;33m$PS4\033[0m"
set -euxo pipefail
npm install -g prettier@3.3.2 @prettier/plugin-xml@3.4.1
prettier --write "docs/_build/html/**/*.{js,css,html,xml}"
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: html
path: docs/_build/html
if-no-files-found: error
include-hidden-files: true