Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: CI

on:
pull_request:
branches: [ main ]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
BUILD_TARGET: [release] # refers to a cargo profile
outputs:
release_built: ${{ steps.set-output.outputs.release_built }}
steps:
- uses: actions/checkout@v5

- name: Cache
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}

- name: Build binaries in "${{ matrix.BUILD_TARGET }}" mode
run: cargo build --profile ${{ matrix.BUILD_TARGET }}


# this is kind of a hack bc building in the integration test doesn't seem to be working
- name: build debug executables
run: cargo build --profile dev

- name: Run tests in "${{ matrix.BUILD_TARGET }}" mode
run: cargo test --profile ${{ matrix.BUILD_TARGET }}
continue-on-error: true # This allows subsequent steps to run
8 changes: 5 additions & 3 deletions tests/integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const TESTS: LazyCell<HashMap<&'static str, (&'static str, &'static str)>> = Laz
fn assemble_to_emu_test() {
// build the executables
assert!(process::Command::new(env!("CARGO"))
.args(["build"])
.args(["build", "--profile", "dev"])
.stdout(Stdio::null())
.stderr(Stdio::null())
.spawn()
Expand All @@ -44,7 +44,8 @@ fn assemble_to_emu_test() {
.into_iter()
.map(|exe| {
PathBuf::from(env!("CARGO_MANIFEST_DIR"))
.join("..")
.parent()
.unwrap()
.join("target")
.join("debug")
.join(exe)
Expand All @@ -55,7 +56,8 @@ fn assemble_to_emu_test() {

for (test, (input, output)) in TESTS.iter() {
let file_path = PathBuf::from(env!("CARGO_MANIFEST_DIR"))
.join("..")
.parent()
.unwrap()
.join("tests")
.join("samples")
.join(format!("{}.asm", test));
Expand Down