From d8695da1d17032d785f9e43502757dc5aa9aa109 Mon Sep 17 00:00:00 2001 From: Tamo Date: Mon, 21 Jun 2021 19:54:43 +0200 Subject: [PATCH 1/3] improve the ci --- .github/workflows/rust.yml | 75 ++++++++++++++++++++++++++++++++++++++ .github/workflows/test.yml | 63 -------------------------------- 2 files changed, 75 insertions(+), 63 deletions(-) create mode 100644 .github/workflows/rust.yml delete mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml new file mode 100644 index 000000000..02efb7cd5 --- /dev/null +++ b/.github/workflows/rust.yml @@ -0,0 +1,75 @@ +name: Rust + +on: + push: + branches: [ staging, trying ] + pull_request: + branches: [ main ] + +env: + CARGO_TERM_COLOR: always + +jobs: + tests: + name: Tests on ${{ matrix.os }} with ${{ matrix.rust }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-18.04, macos-latest] + rust: + - stable + - beta + - nightly + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: ${{ matrix.rust }} + override: true + - name: Run cargo check + uses: actions-rs/cargo@v1 + with: + command: check + args: --all --locked + - name: Run cargo test + uses: actions-rs/cargo@v1 + with: + command: test + args: --locked --release + + # We don't run test on Windows since we get the following error: There is not enough space on the disk. + check-on-windows: + name: Cargo check on Windows + runs-on: windows-latest + steps: + - uses: actions/checkout@v2 + - name: Run cargo check without any default features + uses: actions-rs/cargo@v1 + with: + command: check + args: --all --locked + - name: Run cargo check with all default features + uses: actions-rs/cargo@v1 + with: + command: check + + fmt: + name: Run Rustfmt + runs-on: ubuntu-18.04 + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: nightly + override: true + components: rustfmt + - name: Run cargo fmt + run: | + # Since we never ran the `build.rs` script in the benchmark directory we are missing one auto-generated import file. + # Since we want to trigger (and fail) this action as fast as possible, instead of building the benchmark crate + # we are going to create an empty file where rustfmt expect it. + echo -ne "\n" > benchmarks/benches/datasets_paths.rs + cargo fmt --all -- --check diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index 4ee17a239..000000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,63 +0,0 @@ -name: Continuous integration - -on: - push: - branches: [ staging, trying ] - pull_request: - branches: [ main ] - -jobs: - ci: - runs-on: ubuntu-latest - strategy: - matrix: - rust: - - stable - - beta - # We temporarily stop building on nightly just to fix this issue - # https://github.com/bheisler/TinyTemplate/pull/17 - # Reenable it when the fix has been merged. - # - nightly - - steps: - - uses: actions/checkout@v2 - - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: ${{ matrix.rust }} - override: true - components: rustfmt, clippy - - - uses: actions-rs/cargo@v1 - with: - command: check - args: --all --locked - - - uses: actions-rs/cargo@v1 - with: - command: build - - - uses: actions-rs/cargo@v1 - with: - command: test - - - uses: actions-rs/cargo@v1 - with: - command: bench - args: --no-run -p benchmarks - - # - uses: actions-rs/cargo@v1 - # with: - # command: bench - # args: --no-run - - # - uses: actions-rs/cargo@v1 - # with: - # command: fmt - # args: -- --check - - # - uses: actions-rs/cargo@v1 - # with: - # command: clippy - # args: --all-targets -- -D warnings From 5099192c4499d57736a650813a17c1bf5474ad47 Mon Sep 17 00:00:00 2001 From: Tamo Date: Wed, 23 Jun 2021 10:21:16 +0200 Subject: [PATCH 2/3] update bors.toml --- .github/workflows/rust.yml | 6 +++--- bors.toml | 9 ++++++++- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 02efb7cd5..e87848f94 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -67,9 +67,9 @@ jobs: override: true components: rustfmt - name: Run cargo fmt + # Since we never ran the `build.rs` script in the benchmark directory we are missing one auto-generated import file. + # Since we want to trigger (and fail) this action as fast as possible, instead of building the benchmark crate + # we are going to create an empty file where rustfmt expects it. run: | - # Since we never ran the `build.rs` script in the benchmark directory we are missing one auto-generated import file. - # Since we want to trigger (and fail) this action as fast as possible, instead of building the benchmark crate - # we are going to create an empty file where rustfmt expect it. echo -ne "\n" > benchmarks/benches/datasets_paths.rs cargo fmt --all -- --check diff --git a/bors.toml b/bors.toml index 3fbc6159e..b4deacf9a 100644 --- a/bors.toml +++ b/bors.toml @@ -1,5 +1,12 @@ status = [ - 'ci (stable)' + 'Tests on ubuntu-18.04 with stable', + 'Tests on ubuntu-18.04 with beta', + 'Tests on ubuntu-18.04 with nightly', + 'Tests on macos-latest with stable', + 'Tests on macos-latest with beta', + 'Tests on macos-latest with nightly', + 'Cargo check on Windows', + 'Run Rustfmt', ] # 3 hours timeout timeout-sec = 10800 From faa3cd3b717a924869509ecfcd94b26f0432e36d Mon Sep 17 00:00:00 2001 From: Irevoire Date: Wed, 23 Jun 2021 14:30:33 +0200 Subject: [PATCH 3/3] Update bors.toml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Don't check nightly and beta channel Co-authored-by: Clément Renault --- bors.toml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/bors.toml b/bors.toml index b4deacf9a..bc33262b7 100644 --- a/bors.toml +++ b/bors.toml @@ -1,10 +1,6 @@ status = [ 'Tests on ubuntu-18.04 with stable', - 'Tests on ubuntu-18.04 with beta', - 'Tests on ubuntu-18.04 with nightly', 'Tests on macos-latest with stable', - 'Tests on macos-latest with beta', - 'Tests on macos-latest with nightly', 'Cargo check on Windows', 'Run Rustfmt', ]