-
Notifications
You must be signed in to change notification settings - Fork 1
200 lines (164 loc) · 4.95 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
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
name: CI
on:
push:
branches:
- source
pull_request:
types:
- opened
- synchronize
- reopened
merge_group:
env:
PANDOC_VERSION: "3.0.1"
PYTHON_VERSION: "3.9"
jobs:
check-vehicle:
name: Check Vehicle on ${{ matrix.os.name }}
runs-on: ${{ matrix.os.type }}
steps:
- name: Get source
uses: actions/checkout@v3
- name: Setup Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: "pip" # caching pip dependencies
cache-dependency-path: "requirements.txt"
- name: Install dependencies
run: pip install -r requirements.txt
shell: sh
- name: Check Vehicle
run: find . -name '*.vcl' -exec vehicle check -s {} \;
shell: sh
strategy:
matrix:
os:
- name: Linux
type: ubuntu-latest
- name: macOS
type: macos-latest
- name: Windows
type: windows-latest
update-readme:
name: Update README.md
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Get source
uses: actions/checkout@v3
- name: Setup Pandoc
uses: pandoc/actions/[email protected]
with:
version: ${{ env.PANDOC_VERSION }}
- name: Update README.md
run: make gfm
- name: Commit README.md
if: github.event_name == 'push'
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: "Update README.md"
file_pattern: "README.md"
# Compile the tutorial to a PDF
build-pdf:
name: Build PDF
runs-on: ubuntu-latest
steps:
- name: Get source
uses: actions/checkout@v3
- name: Setup Pandoc
uses: pandoc/actions/[email protected]
with:
version: ${{ env.PANDOC_VERSION }}
- name: Compile tutorial to LaTeX
run: make latex
- name: Compile tutorial to PDF
uses: xu-cheng/latex-action@v2
with:
latexmk_use_lualatex: true
latexmk_shell_escape: true
extra_system_packages: |
inkscape
python3
pre_compile: |
python -m ensurepip --default-pip
pip install pygments
pip install vehicle_lang
root_file: tutorial.tex
- name: Upload generated PDF as artifact
uses: actions/upload-artifact@v3
with:
name: pdf
path: ./tutorial.pdf
if-no-files-found: error
# Compile the tutorial to an HTML page
build-html:
name: Build HTML
runs-on: ubuntu-latest
steps:
- name: Get source
uses: actions/checkout@v3
- name: Setup Pandoc
uses: pandoc/actions/[email protected]
with:
version: ${{ env.PANDOC_VERSION }}
- name: Setup Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: "pip" # caching pip dependencies
cache-dependency-path: "requirements.txt"
- name: Install dependencies
run: pip install -r requirements.txt
shell: sh
- name: Compile tutorial to an HTML page
run: make html
- name: Upload generated HTML page as artifact
uses: actions/upload-artifact@v3
with:
name: html
path: ./_site/
if-no-files-found: error
# Upload the tutorial to pages
update-pages:
name: Update Pages
runs-on: ubuntu-latest
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false
steps:
- name: Get source
uses: actions/checkout@v3
- name: Setup Pandoc
uses: pandoc/actions/[email protected]
with:
version: ${{ env.PANDOC_VERSION }}
- name: Setup Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: "pip" # caching pip dependencies
cache-dependency-path: "requirements.txt"
- name: Install dependencies
run: pip install -r requirements.txt
shell: sh
- name: Build HTML page
run: make html
- name: Setup Pages
if: github.event_name == 'push'
uses: actions/configure-pages@v3
- name: Upload Pages artifact
if: github.event_name == 'push'
uses: actions/upload-pages-artifact@v1
- name: Deploy to GitHub Pages
if: github.event_name == 'push'
id: deployment
uses: actions/deploy-pages@v2