-
Notifications
You must be signed in to change notification settings - Fork 11
130 lines (118 loc) · 3.74 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
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
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@v4
- name: Run hooks again to validate they have run
uses: xu-cheng/texlive-action@v2
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
python3 -m venv venv
source venv/bin/activate
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_lecture:
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@v4
- 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@v2
with:
run: |
apk add make
apk add git
git config --global --add safe.directory /github/workspace
git config --global --add safe.directory /home/runner/work/KDD/KDD
cd lecture
ls -la img
make all-wo-figures
- name: Upload artifacts
uses: actions/upload-artifact@v4
if: always()
with:
name: Lecture Slides
path: |
lecture/output/*.pdf
lecture/output/*.log
retention-days: 90
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@v4
- name: Create the exercise archives
uses: xu-cheng/texlive-action@v2
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
python3 -m venv venv
source venv/bin/activate
pip3 install -r exercise/requirements.txt
cd exercise
make all
- name: Upload artifacts
uses: actions/upload-artifact@v4
if: always()
with:
name: Exercise Archives
path: |
exercise/output/*.zip
retention-days: 90
build_submission:
name: Build the submission PDFs
runs-on: ubuntu-latest
needs: [pre_commit_validation]
if: contains(needs.*.result, 'success')
steps:
- name: Set up Git repository
uses: actions/checkout@v4
- name: Create the submission PDFs
uses: xu-cheng/texlive-action@v2
with:
run: |
apk update
apk upgrade
apk add --virtual build-dependencies build-base gcc wget git
cd submission
make all
- name: Upload artifacts
uses: actions/upload-artifact@v4
if: always()
with:
name: Submission PDFs
path: |
submission/output/*.pdf
retention-days: 90