-
Notifications
You must be signed in to change notification settings - Fork 17
64 lines (55 loc) · 1.51 KB
/
build_and_test.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
name: Build and test the compiler
on:
workflow_call:
inputs:
os:
required: true
type: string
chapter:
required: true
type: string
branch:
type: string
required: false
default: main
tests-branch:
type: string
required: false
default: main
jobs:
build:
uses: ./.github/workflows/build.yaml
with:
chapter: ${{ inputs.chapter }}
os: ${{ inputs.os }}
branch: ${{ inputs.branch }}
test:
runs-on: ${{ inputs.os }}
needs: [build]
env:
CHAPTER: ${{ inputs.chapter }}
steps:
- name: Check out tests
uses: actions/checkout@v4
with:
repository: nlsandler/writing-a-c-compiler-tests
ref: ${{ inputs.tests-branch }}
- name: Check out test runner script
uses: actions/checkout@v4
with:
repository: nlsandler/nqcc2
ref: ${{ inputs.branch }}
sparse-checkout: |
.github/run_tests.py
sparse-checkout-cone-mode: false
path: script
- name: Download the compiler
uses: actions/download-artifact@v4
with:
name: nqcc-${{inputs.os}}-${{ inputs.chapter }}
path: nqcc
# make NQCC executable
- run: chmod u+x nqcc/main.exe
# Invoke the run_tests.py script to test each intermediate stage
- name: Run the tests
run: ./script/.github/run_tests.py nqcc/main.exe --chapter "${CHAPTER}" --no-extra-opts