-
Notifications
You must be signed in to change notification settings - Fork 12
100 lines (89 loc) · 2.77 KB
/
push-actions.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
on: [push]
jobs:
pre_commit_validation:
name: Validate that pre-commit hooks have run
runs-on: ubuntu-latest
steps:
- name: Set up Git repository
uses: actions/checkout@v3
- name: Run hooks again to validate they have run
uses: xu-cheng/texlive-action/full@v1
with:
run: |
apk update
apk upgrade
apk add --virtual build-dependencies build-base gcc wget git
apk add --no-cache python3 python3-dev py3-pip nodejs npm
pip3 install pre-commit
git config --global --add safe.directory /github/workspace
pre-commit run --verbose --all-files > pre-commit-validation.txt & cat pre-commit-validation.txt
if cat pre-commit-validation.txt | grep -q Failed;
then
echo "Pre-commit run did not run on local machine."
exit 1
else
echo "Pre-commit did run on local machine."
fi
build_latex:
name: Build lecture PDFs
runs-on: ubuntu-latest
needs: [pre_commit_validation]
if: contains(needs.*.result, 'success')
steps:
- name: Set up Git repository
uses: actions/checkout@v3
- name: Build figures
uses: ./lecture/
env:
WORKSPACE: ${{ github.workspace }}
with:
run: |
cd $WORKSPACE/lecture
make figures
- name: Compile LaTeX document
uses: xu-cheng/texlive-action/full@v1
with:
run: |
apk add make
apk add git
git config --global --add safe.directory /github/workspace
cd lecture
ls -la img
make all-wo-figures
- name: Upload artifacts
uses: actions/upload-artifact@v3
if: always()
with:
name: Lecture Slides
path: |
lecture/output/*.pdf
lecture/output/*.log
retention-days: 5
build_exercise:
name: Build the exercise archives
runs-on: ubuntu-latest
needs: [pre_commit_validation]
if: contains(needs.*.result, 'success')
steps:
- name: Set up Git repository
uses: actions/checkout@v3
- name: Initialize Python 3.7
uses: actions/setup-python@v4
with:
python-version: 3.7
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r exercise-old/requirements.txt
- name: Build archives
run: |
cd exercise-old
make all
- name: Upload artifacts
uses: actions/upload-artifact@v3
if: always()
with:
name: Exercise Archives
path: |
exercise-old/output/*.zip
retention-days: 5