diff --git a/.github/workflows/CICD.yml b/.github/workflows/CICD.yml index 7c2351a8..e675781f 100644 --- a/.github/workflows/CICD.yml +++ b/.github/workflows/CICD.yml @@ -46,6 +46,11 @@ jobs: with: package: tree-sitter-cli + sanitize: + name: Sanitize + needs: [init, fast_checks] + uses: ./.github/workflows/sanitize.yml + build: name: Build & Test needs: [init, fast_checks] @@ -55,7 +60,7 @@ jobs: release: name: Release - needs: [init, fast_checks, full_checks, min_version, build] + needs: [init, fast_checks, full_checks, min_version, build, sanitize] if: > github.event.pull_request.head.repo.full_name == github.repository && startsWith(github.head_ref, 'release/v') diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 61543552..6cfa0d48 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -6,6 +6,7 @@ env: CROSS_DEBUG: 1 on: + workflow_dispatch: workflow_call: inputs: ref: @@ -174,34 +175,3 @@ jobs: lib/binding_web/tree-sitter.wasm if-no-files-found: error retention-days: 7 - - check_undefined_behaviour: - name: Undefined behaviour checks - runs-on: ubuntu-latest - env: - TREE_SITTER: ${{ github.workspace }}/target/release/tree-sitter - steps: - - name: Checkout source code - uses: actions/checkout@v3 - - - name: Install UBSAN library - run: sudo apt-get install -y libubsan1 - - - name: Install Rust toolchain - uses: dtolnay/rust-toolchain@stable - - - name: Build CLI - run: cargo build --release - - - name: Fetch fixtures - run: script/fetch-fixtures - - - name: Generate fixtures - run: script/generate-fixtures - - - name: Run main tests with undefined behaviour sanitizer (UBSAN) - env: - UBSAN_OPTIONS: halt_on_error=1 - CFLAGS: -fsanitize=undefined - RUSTFLAGS: -lubsan - run: cargo test -- --test-threads 1 diff --git a/.github/workflows/sanitize.yml b/.github/workflows/sanitize.yml new file mode 100644 index 00000000..ebfb477c --- /dev/null +++ b/.github/workflows/sanitize.yml @@ -0,0 +1,40 @@ +name: Sunitize + +env: + CARGO_TERM_COLOR: always + RUSTFLAGS: "-D warnings" + +on: + workflow_call: + +jobs: + check_undefined_behaviour: + name: Undefined behaviour checks + runs-on: ubuntu-latest + env: + TREE_SITTER: ${{ github.workspace }}/target/release/tree-sitter + steps: + - name: Checkout source code + uses: actions/checkout@v3 + + - name: Install UBSAN library + run: sudo apt-get install -y libubsan1 + + - name: Install Rust toolchain + uses: dtolnay/rust-toolchain@stable + + - name: Build CLI + run: cargo build --release + + - name: Fetch fixtures + run: script/fetch-fixtures + + - name: Generate fixtures + run: script/generate-fixtures + + - name: Run main tests with undefined behaviour sanitizer (UBSAN) + env: + UBSAN_OPTIONS: halt_on_error=1 + CFLAGS: -fsanitize=undefined + RUSTFLAGS: -lubsan + run: cargo test -- --test-threads 1