Merge pull request #2896 from dundargoc/ci/fast_checks

ci: merge fast_checks into full_rust_checks
This commit is contained in:
Amaan Qureshi 2024-02-02 21:00:44 -05:00 committed by GitHub
commit 4e8a9e654f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 38 additions and 75 deletions

View file

@ -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') &&

32
.github/workflows/checks.yml vendored Normal file
View file

@ -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"

View file

@ -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"

View file

@ -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