-
Notifications
You must be signed in to change notification settings - Fork 8
166 lines (128 loc) · 4.89 KB
/
main.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
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
name: CI
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
branches: [ master ]
pull_request:
branches: ['**']
jobs:
List-Courses:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# Black magic to generate the list of courses from the python script to JSON
-
id: set-courses
run: |
courses="$(python3 contrib/ci/course.py find courses/ --json)"
echo "courses=$courses" >> $GITHUB_OUTPUT
outputs:
matrix: ${{steps.set-courses.outputs.courses}}
Slides:
needs: List-Courses
runs-on: ubuntu-latest
container: public.ecr.aws/w0s6m4g9/pandoc-beamer:latest
strategy:
fail-fast: false
matrix:
# Import list of courses from the List-Courses job
source: ${{fromJson(needs.List-Courses.outputs.matrix)}}
steps:
- uses: actions/checkout@v4
- name: Check source is updated with prelude
run: python3 contrib/ci/fix_prelude.py
- name: Prepare slides environment
run: python3 contrib/ci/slides.py ${{ format('{0}/{1}', 'courses', matrix.source) }} printenv >> $GITHUB_ENV
- name: ${{ env.PRETTY_NAME }} - Build
run: python3 pandoc/pandoc_fe.py --output-dir ${{ env.OUTPUT_DIR }} --hush --extension pdf --source ${{ env.SOURCES }}
- name: ${{ env.PRETTY_NAME }} - Package and upload
uses: actions/upload-artifact@v4
with:
name: ${{ env.PRETTY_NAME }}
path: ${{ env.ARTIFACTS }}
if-no-files-found: error
Labs-Slides:
runs-on: ubuntu-latest
container: sawertyu/pandoc_beamer:latest
steps:
- uses: actions/checkout@v4
- name: GNAT SAS - Package
run: python3 contrib/ci/package_labs.py courses/gnatsas/labs/ && mv out/labs out/gnatsas_labs && unzip out/gnatsas_labs/labs.zip -d out/gnatsas_labs/pkg
- name: GNAT SAS - Upload
uses: actions/upload-artifact@v4
with:
name: GNAT SAS labs
path: out/gnatsas_labs/pkg/*
if-no-files-found: error
- name: GNAT Project Facility - Package
run: python3 contrib/ci/package_labs.py courses/gnat_project_facility/labs/ && mv out/labs out/gnat_project_facility_labs && unzip out/gnat_project_facility_labs/labs.zip -d out/gnat_project_facility_labs/pkg
- name: GNAT Project Facility - Upload
uses: actions/upload-artifact@v4
with:
name: GNAT Project Facility labs
path: out/gnat_project_facility_labs/pkg/*
if-no-files-found: error
- name: Mini Cinema - Package
run: python3 contrib/ci/package_labs.py courses/fundamentals_of_ada/mini_projects/cinema && unzip out/cinema/cinema.zip -d out/cinema/pkg
- name: Mini Cinema - Upload
uses: actions/upload-artifact@v4
with:
name: Mini Project - Mini Cinema
path: out/cinema/pkg/*
if-no-files-found: error
labs-build:
name: Labs # intentionly short
strategy:
matrix:
os: [ubuntu-latest] #windows-latest TODO
runs-on: ${{ matrix.os }}
container: sawertyu/alr:latest
steps:
- uses: actions/checkout@v4
- name: Update base system
run: |
apt update
apt install -y python3
- name: Install GNAT & GPRbuild
run: |
alr toolchain --install gnat_native=12.2.1 gprbuild=22.0.1
- name: Solution build for Ada Fundamentals
run: |
. contrib/ci/lab_env.profile
python3 contrib/ci/build_labs_check.py courses/fundamentals_of_ada/labs
python-black:
name: Python scripts black lint check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install black
run: python3 -m pip install "black>=24.0.0,<25.0.0"
- name: Run black on contrib/
run: python3 -m black --check $(find contrib -name '*.py')
- name: Run black on pandoc/
run: python3 -m black --check $(find pandoc -name '*.py')
pytest:
name: Contrib scripts check
runs-on: ubuntu-latest
container: sawertyu/alr:latest
steps:
- uses: actions/checkout@v4
- name: Update base system
run: |
apt update
apt install -y python3 python3-pip pandoc
- name: Install GNAT & GPRbuild
run: |
alr toolchain --install gnat_native=12.2.1 gprbuild=22.0.1
- name: Setup Python
run: python3 -m pip install pytest epycs pandocfilters adacut
- name: Run PyTest
run: pytest --ignore=cached_gnat --ignore=courses/fundamentals_of_ada/labs/radar/test_all.py
- name: Check Quizes
run: |
. contrib/ci/alr_gnat_env.profile
python3 contrib/quiz_update.py -v courses/fundamentals_of_ada/quiz/