From a4b549f78bafd4d9ecf7099e38227ba3c8504d05 Mon Sep 17 00:00:00 2001 From: wznmickey Date: Mon, 30 Dec 2024 12:18:16 +0800 Subject: [PATCH 1/4] Update rustTest.yml --- .github/workflows/rustTest.yml | 50 ++++++++++++++++++++++++---------- 1 file changed, 36 insertions(+), 14 deletions(-) diff --git a/.github/workflows/rustTest.yml b/.github/workflows/rustTest.yml index d54fa2f..24673f2 100644 --- a/.github/workflows/rustTest.yml +++ b/.github/workflows/rustTest.yml @@ -1,22 +1,44 @@ -name: Rust - -on: - push: - branches: [ "master" ] - pull_request: - branches: [ "master" ] +name: Continuous integration +on: [push, pull_request, merge_group] env: - CARGO_TERM_COLOR: always + # RUSTFLAGS: "-Dwarnings" + # RUSTDOCFLAGS: "-Dwarnings" jobs: - build: + # This allows us to have one branch protection rule for the full test matrix. + # See: https://github.com/orgs/community/discussions/4324 + checks: + name: Check clippy, formatting, and documentation + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@1.83.0 + with: + components: clippy, rustfmt + - uses: Swatinem/rust-cache@v2 + - run: cargo clippy --workspace --all-targets --all-features + - run: cargo clippy --workspace --all-targets --no-default-features + - run: cargo fmt --check --all + - run: cargo doc --workspace --no-deps + min-version: + name: Check minimum Rust version runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@1.80.0 + - uses: Swatinem/rust-cache@v2 + - run: cargo check --workspace + fuzz: + name: Check fuzzers + runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - name: Build - run: cargo build --verbose - - name: Run tests - run: cargo test --verbose + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@master + with: + toolchain: nightly-2024-10-29 + - uses: Swatinem/rust-cache@v2 + - run: cargo install --locked cargo-fuzz@0.12.0 + - run: cd tests/fuzz && cargo fuzz build --dev From 7b7148db390e35abfa93c61949b12dfb5daa2b45 Mon Sep 17 00:00:00 2001 From: wznmickey Date: Mon, 30 Dec 2024 12:18:42 +0800 Subject: [PATCH 2/4] Update rustTest.yml --- .github/workflows/rustTest.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rustTest.yml b/.github/workflows/rustTest.yml index 24673f2..9d0ecd9 100644 --- a/.github/workflows/rustTest.yml +++ b/.github/workflows/rustTest.yml @@ -1,5 +1,5 @@ name: Continuous integration -on: [push, pull_request, merge_group] +on: [push, pull_request, merge_group, workflow_dispatch] env: # RUSTFLAGS: "-Dwarnings" From 09c16df37d205390c9fa14613262483a9e45d3e7 Mon Sep 17 00:00:00 2001 From: wznmickey Date: Mon, 30 Dec 2024 12:19:01 +0800 Subject: [PATCH 3/4] Update rustTest.yml --- .github/workflows/rustTest.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rustTest.yml b/.github/workflows/rustTest.yml index 9d0ecd9..cb4da92 100644 --- a/.github/workflows/rustTest.yml +++ b/.github/workflows/rustTest.yml @@ -1,7 +1,7 @@ name: Continuous integration on: [push, pull_request, merge_group, workflow_dispatch] -env: +#env: # RUSTFLAGS: "-Dwarnings" # RUSTDOCFLAGS: "-Dwarnings" From 790b277d5a9dfede4d14be6aaf0d69f32aaae607 Mon Sep 17 00:00:00 2001 From: wznmickey Date: Mon, 30 Dec 2024 12:29:56 +0800 Subject: [PATCH 4/4] Update rustTest.yml --- .github/workflows/rustTest.yml | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/.github/workflows/rustTest.yml b/.github/workflows/rustTest.yml index cb4da92..899e9dc 100644 --- a/.github/workflows/rustTest.yml +++ b/.github/workflows/rustTest.yml @@ -1,9 +1,9 @@ +# Modified from https://github.com/typst/typst/blob/main/.github/workflows/ci.yml name: Continuous integration on: [push, pull_request, merge_group, workflow_dispatch] - -#env: - # RUSTFLAGS: "-Dwarnings" - # RUSTDOCFLAGS: "-Dwarnings" +env: + RUSTFLAGS: "-Dwarnings" + RUSTDOCFLAGS: "-Dwarnings" jobs: # This allows us to have one branch protection rule for the full test matrix. @@ -30,15 +30,6 @@ jobs: - uses: dtolnay/rust-toolchain@1.80.0 - uses: Swatinem/rust-cache@v2 - run: cargo check --workspace - - fuzz: - name: Check fuzzers - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@master - with: - toolchain: nightly-2024-10-29 - uses: Swatinem/rust-cache@v2 - run: cargo install --locked cargo-fuzz@0.12.0 - run: cd tests/fuzz && cargo fuzz build --dev