forked from nexusformat/definitions
-
Notifications
You must be signed in to change notification settings - Fork 8
executable file
·117 lines (102 loc) · 3.39 KB
/
ci.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
name: CI
on:
push:
branches:
- main
- fairmat # push commit to the fairmat branch
pull_request:
branches:
- main
- fairmat # pull request to the fairmat branch
workflow_dispatch: # allow manual triggering
inputs:
deploy:
description: 'Deploy documentation'
type: boolean
required: true
default: false
upload:
description: 'Upload documentation (pdfs in _static/)'
type: boolean
required: true
default: false
defaults:
run:
shell: bash
jobs:
build-linux:
name: CI py${{ matrix.python-version }}
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
max-parallel: 5
env:
python_version: ${{ matrix.python-version }}
python_deploy_version: '3.8' # version to use for deployment
steps:
- name: Checkout Repository
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Deploy Information
if: ${{ github.event.inputs.deploy && env.python_version == env.python_deploy_version }}
run: |
echo "The HTML NeXus User Manual will be pushed to"
echo " https://github.com/nexusformat/definitions/tree/gh-pages"
echo "The HTML NeXus User Manual will be deployed on"
echo " https://nexusformat.github.io/definitions/"
- name: Install Requirements
run: |
python3 -m pip install --upgrade pip setuptools
make install
python3 -m pip list
- name: Check Code Style
run: |
make style
- name: Run Tests
run: |
make test
- name: Install LaTeX
run: |
sudo apt-get update -y && \
sudo apt-get install -y \
latexmk \
texlive-latex-recommended \
texlive-latex-extra \
texlive-fonts-recommended
tex --version
- name: Generate build files
env:
GH_TOKEN: ${{ (env.python_version == env.python_deploy_version && (github.event.inputs.deploy || github.event.inputs.upload)) && secrets.GITHUB_TOKEN || 'NONE' }}
run: |
make prepare
- name: Build Impatient Guide
run: |
make impatient-guide
ls -lAFgh build/impatient-guide/build/html/index.html
mkdir -p build/html
mv build/impatient-guide/build/html build/html/impatient
- name: Build User Manual
run: |
make pdf
make html
ls -lAFgh build/manual/build/html/index.html
mkdir -p build/html
mv build/manual/build/html/* build/html
- name: Deploy both the User Manual and the Impatient Guide
if: ${{ github.event.inputs.deploy && env.python_version == env.python_deploy_version }}
uses: JamesIves/github-pages-deploy-action@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
folder: build/html
- name: Upload the User Manual and the Impatient Guide
if: ${{ github.event.inputs.upload && env.python_version == env.python_deploy_version }}
uses: actions/upload-artifact@v3
with:
name: nexus-definitions-docs
path: build/html