-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial CI setup and a few tests (#21)
* [X] Simple CI setup to build and test smir_pretty * [x] a directory of small test programs and golden files to compare to (json to be formatted and normalised using `jq`) * [x] resolve issues with toolchain setup (from prior runs?) on runners * [ ] analyse and fix Rust build artefact caching Related: #20
- Loading branch information
Showing
75 changed files
with
170,981 additions
and
4 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
name: 'Test' | ||
on: | ||
pull_request: | ||
branches: [ "master" ] | ||
push: | ||
branches: [ "master" ] | ||
workflow_dispatch: | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
|
||
jobs: | ||
|
||
integration-tests: | ||
name: "Integration tests" | ||
runs-on: [self-hosted, linux, normal] | ||
steps: | ||
- name: 'Check out code' | ||
uses: actions/checkout@v4 | ||
with: | ||
# Check out pull request HEAD instead of merge commit. | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
submodules: recursive | ||
|
||
- name: "Set up nightly Rust" # https://github.com/rust-lang/rustup/issues/3409 | ||
uses: dtolnay/rust-toolchain@master | ||
with: | ||
toolchain: nightly-2024-08-28 | ||
|
||
- name: 'Set up tree for rust dependency' | ||
run: make setup | ||
|
||
- name: 'Cache smir_pretty and rustc' | ||
uses: Swatinem/rust-cache@v2 | ||
with: | ||
workspaces: | | ||
. | ||
deps/rust/src | ||
cache-directories: | | ||
target | ||
deps/rust/src/build | ||
deps/rust/src/target | ||
- name: 'Build smir_pretty and its rustc dependency' | ||
run: | # rustc bootstrap checks this and refuses stage 1 in "CI" | ||
export GITHUB_ACTIONS="in denial" && \ | ||
echo "GITHUB_ACTIONS = ${GITHUB_ACTIONS}" && \ | ||
make build_all | ||
- name: 'Run smir integration tests' | ||
run: | | ||
make integration-test | ||
- name: 'Clean up toolchain' | ||
if: always() | ||
run: | | ||
make rustup-clear-toolchain |
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
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
tests/integration/failing/panic_example.rs |
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
tests/integration/failing/panic_example.smir.json.expected |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
fn main() { | ||
let a = [1, 2, 3, 4]; | ||
|
||
assert!(a == [1, 2, 3, 4]); | ||
} |
Oops, something went wrong.