Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix benchmarks on windows #770

Merged
merged 1 commit into from
Jun 20, 2024
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
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