Skip to content

add the skully program #297

add the skully program

add the skully program #297

Workflow file for this run

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 passes lang30
- name: "Check the source language grammar"
run: bin/passtool verify spec 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: nim c -d:nimStrictMode -d:release --outdir:bin skully/skully.nim
- 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)"