From b122c59ca36f15a7194751e8407a2bb047761e11 Mon Sep 17 00:00:00 2001 From: dundargoc Date: Fri, 2 Feb 2024 11:38:12 +0100 Subject: [PATCH] ci: merge fast_checks into full_rust_checks It's not necessary to have two separate linting workflows as the full lints themselves are very quick. --- .github/workflows/CICD.yml | 18 +++++---------- .github/workflows/checks.yml | 32 ++++++++++++++++++++++++++ .github/workflows/fast_checks.yml | 31 ------------------------- .github/workflows/full_rust_checks.yml | 32 -------------------------- 4 files changed, 38 insertions(+), 75 deletions(-) create mode 100644 .github/workflows/checks.yml delete mode 100644 .github/workflows/fast_checks.yml delete mode 100644 .github/workflows/full_rust_checks.yml diff --git a/.github/workflows/CICD.yml b/.github/workflows/CICD.yml index fcdb6ea9..a700f4d8 100644 --- a/.github/workflows/CICD.yml +++ b/.github/workflows/CICD.yml @@ -40,37 +40,31 @@ jobs: || github.ref }} - fast_checks: - name: Fast checks - uses: ./.github/workflows/fast_checks.yml - - full_checks: - name: Full Rust checks - needs: fast_checks - uses: ./.github/workflows/full_rust_checks.yml + checks: + uses: ./.github/workflows/checks.yml min_version: name: Minimum supported rust version - needs: fast_checks + needs: checks uses: ./.github/workflows/msrv.yml with: package: tree-sitter-cli sanitize: name: Sanitize - needs: [init, fast_checks] + needs: [init, checks] uses: ./.github/workflows/sanitize.yml build: name: Build & Test - needs: [init, fast_checks] + needs: [init, checks] uses: ./.github/workflows/build.yml with: ref: ${{ needs.init.outputs.ref }} release: name: Release - needs: [init, fast_checks, full_checks, min_version, build, sanitize] + needs: [init, checks, min_version, build, sanitize] if: > github.event_name == 'pull_request' && startsWith(github.head_ref, 'release/v') && diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml new file mode 100644 index 00000000..96a2ce25 --- /dev/null +++ b/.github/workflows/checks.yml @@ -0,0 +1,32 @@ +name: Full Rust codebase checks + +env: + CARGO_TERM_COLOR: always + RUSTFLAGS: "-D warnings" + +on: + workflow_call: + +jobs: + run: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Install rust toolchain + uses: dtolnay/rust-toolchain@master + with: + toolchain: stable + components: clippy, rustfmt + + - run: cargo fmt -- --check + - run: cargo check --workspace --examples --tests --benches --bins + + check_c_warnings: + name: Check C warnings + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Make C library to check that it's able to compile without warnings + run: make -j CFLAGS="-Werror" diff --git a/.github/workflows/fast_checks.yml b/.github/workflows/fast_checks.yml deleted file mode 100644 index ea474799..00000000 --- a/.github/workflows/fast_checks.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: Fast checks to fail fast on any simple code issues - -env: - CARGO_TERM_COLOR: always - RUSTFLAGS: "-D warnings" - -on: - workflow_call: - -jobs: - check_rust_formatting: - name: Check Rust formating - runs-on: ubuntu-latest - steps: - - - name: Checkout source code - uses: actions/checkout@v3 - - - name: Run cargo fmt - run: cargo fmt -- --check - - check_c_warnings: - name: Check C warnings - runs-on: ubuntu-latest - steps: - - - name: Checkout source code - uses: actions/checkout@v3 - - - name: Make C library to check that it's able to compile without warnings - run: make -j CFLAGS="-Werror" diff --git a/.github/workflows/full_rust_checks.yml b/.github/workflows/full_rust_checks.yml deleted file mode 100644 index 2cc5f77d..00000000 --- a/.github/workflows/full_rust_checks.yml +++ /dev/null @@ -1,32 +0,0 @@ -name: Full Rust codebase checks - -env: - CARGO_TERM_COLOR: always - RUSTFLAGS: "-D warnings" - -on: - workflow_call: - -jobs: - run: - name: Run checks - runs-on: ubuntu-latest - steps: - - - name: Checkout source code - uses: actions/checkout@v3 - - - name: Install rust toolchain - uses: dtolnay/rust-toolchain@master - with: - toolchain: stable - components: clippy, rustfmt - - - name: Run cargo fmt - run: cargo fmt -- --check - - # - name: Run clippy - # run: cargo clippy --all-targets - - - name: Run cargo check - run: cargo check --workspace --examples --tests --benches --bins