rework the passes and intermediate languages #240
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
# always use the most recent NimSkull version | |
- uses: nim-works/[email protected] | |
with: | |
nimskull-version: "*" | |
- 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 | |
# always use the most recent NimSkull version | |
- uses: nim-works/[email protected] | |
with: | |
nimskull-version: "*" | |
- 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 passes lang30 | |
- name: "Check the source language grammar" | |
run: bin/passtool verify spec spec |