Skip to content

Commit

Permalink
Fix benchmarks on windows (#770)
Browse files Browse the repository at this point in the history
  • Loading branch information
dfellis committed Jun 20, 2024
1 parent e0519d4 commit 4f662ce
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 8 deletions.
15 changes: 11 additions & 4 deletions .github/workflows/bench.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,8 @@ env:
CARGO_TERM_COLOR: always

jobs:
build:

runs-on: self-hosted

bench:
runs-on: [self-hosted, linux]
steps:
- uses: actions/checkout@v4
- name: Build Alan
Expand All @@ -24,3 +22,12 @@ jobs:
run: cargo run -- compile benches/bench.ln
- name: Alan-managed Benchmarks
run: ./bench

bench-windows:
runs-on: [self-hosted, windows]
steps:
- uses: actions/checkout@v4
- name: Build Alan
run: cargo build --verbose
- name: Rust-managed Benchmarks
run: cargo bench
17 changes: 14 additions & 3 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ env:

jobs:
test:

runs-on: self-hosted

runs-on: [self-hosted, linux]
steps:
- uses: actions/checkout@v4
- name: Check lockfile is up to date
Expand All @@ -28,3 +26,16 @@ jobs:
- if: ${{ github.ref_name != 'main' }}
name: Run tests
run: cargo test --verbose

test-windows:
runs-on: [self-hosted, windows]
steps:
- uses: actions/checkout@v4
- name: Build
run: cargo build --verbose
- if: ${{ github.ref_name == 'main' }}
name: Run tests
run: cargo test --verbose -- --include-ignored
- if: ${{ github.ref_name != 'main' }}
name: Run tests
run: cargo test --verbose
6 changes: 5 additions & 1 deletion benches/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@ macro_rules! run {
macro_rules! clean {
( $name:ident ) => {
let sourcefile = format!("{}.ln", stringify!($name));
let executable = format!("{}", stringify!($name));
let executable = if cfg!(windows) {
format!("{}.exe", stringify!($name))
} else {
format!("{}", stringify!($name))
};
remove_file(&sourcefile)?;
remove_file(&executable)?;
};
Expand Down

0 comments on commit 4f662ce

Please sign in to comment.