-
Notifications
You must be signed in to change notification settings - Fork 2
145 lines (117 loc) · 3.84 KB
/
build_and_test.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
name: Build and test
on:
# run on push...
push:
# ... but ignore the main and temporary merge queue branches
branches-ignore:
- main
- gh-readonly-queue/**
pull_request:
# only run for PRs to main
branches:
- main
# only consider certain events
type:
- opened
- synchronize
- reopened
- ready_for_review
merge_group:
# run when something enters the merge queue
# use bash for all script actions
defaults:
run:
shell: bash
jobs:
binaries:
strategy:
fail-fast: false
matrix:
target:
- name: Linux
runner: ubuntu-20.04
- name: MacOS (M1)
runner: macos-14
- name: MacOS
runner: macos-13
- name: Windows
runner: windows-2022
# run the language-related chores first, so that language definition errors
# are reported early and only once
needs: [languages]
name: "Build binaries (${{ matrix.target.name }})"
runs-on: ${{ matrix.target.runner }}
steps:
- uses: actions/checkout@v4
with:
# sparse checkout; we're only interested in the head commit
fetch-depth: 0
filter: tree:0
# use a pinned version in order to make CI runs reproducible
- uses: nim-works/[email protected]
with:
nimskull-version: "0.1.0-dev.21434"
- name: Build koch
run: nim c -d:nimStrictMode --outdir:bin koch.nim
- name: Build all programs
run: bin/koch all -d:nimStrictMode -d:release
# use a debug build (with optimizations enabled) for testing, in order
# to better catch bugs
- name: Build `phy` for testing
run: bin/koch single phy --opt:speed
- name: "Run tests"
run: bin/tester
languages:
name: "Check and generate languages"
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
filter: tree:0
# use a pinned version in order to make CI runs reproducible
- uses: nim-works/[email protected]
with:
nimskull-version: "0.1.0-dev.21434"
- name: Build koch
run: nim c -d:nimStrictMode --outdir:bin koch.nim
- name: Build passtool
run: bin/koch single passtool -d:nimStrictMode -d:release
# run the passtool for the highest-level language:
- name: "Check the IL grammar"
run: bin/passtool verify languages lang30
- name: "Check the source language grammar"
run: bin/passtool verify languages specification
skully:
name: "Test skully"
# use the M1 runner because it's the fastest
runs-on: macos-14
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
filter: tree:0
# use a pinned version in order to make CI runs reproducible
- uses: nim-works/[email protected]
with:
nimskull-version: "0.1.0-dev.21434"
- name: Build koch
run: nim c -d:nimStrictMode --outdir:bin koch.nim
- name: Build phy
run: bin/koch single phy -d:release
- name: Build skully
run: bin/koch single skully -d:nimStrictMode -d:release
- name: Compile phy to L25 code with skully
run: bin/skully phy/phy.nim build/phy.txt
# to make sure the skully-compiled phy program works at least somewhat,
# use it to compile and run a source-language test
- name: Compile and run the L25 code
run: |
result=$(bin/phy --source:L25 e build/phy.txt -- --runner e $TEST_FILE)
if [[ "$result" != $TEST_OUTPUT ]]; then
echo "::error::Got $result , but expected $TEST_OUTPUT"
exit 1
fi
env:
TEST_FILE: tests/expr/t06_call_proc_with_tuple_return_type.test
TEST_OUTPUT: "(100, 200): (int, int)(Done 0)"