diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e117f7dc..aa569cf5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -6,12 +6,20 @@ env: CROSS_DEBUG: 1 on: - workflow_dispatch: workflow_call: inputs: ref: default: ${{ github.ref }} type: string + run-tests: + default: true + type: boolean + workflow_dispatch: + inputs: + run-tests: + description: Run tests + default: true + type: boolean jobs: build: @@ -141,34 +149,34 @@ jobs: run: make.sh CFLAGS="-Werror" -j - name: Build wasm library - if: ${{ !matrix.use-cross && !matrix.cli-only }} # No sense to build on the same Github runner hosts many times + if: ${{ !matrix.cli-only && !matrix.use-cross }} # No sense to build on the same Github runner hosts many times run: script/build-wasm - name: Build CLI run: $BUILD_CMD build --release --target=${{ matrix.target }} - name: Fetch fixtures - if: ${{ !matrix.cli-only }} # Don't fetch fixtures for only CLI building targets + if: ${{ inputs.run-tests && !matrix.cli-only }} # Don't fetch fixtures for only CLI building targets run: script/fetch-fixtures - name: Generate fixtures - if: ${{ !matrix.cli-only }} # Can't natively run CLI on Github runner's host + if: ${{ inputs.run-tests && !matrix.cli-only }} # Can't natively run CLI on Github runner's host run: script/generate-fixtures - name: Generate WASM fixtures - if: ${{ !matrix.use-cross && !matrix.cli-only }} # See comment for the "Build wasm library" step + if: ${{ inputs.run-tests && !matrix.cli-only && !matrix.use-cross }} # See comment for the "Build wasm library" step run: script/generate-fixtures-wasm - name: Run main tests - if: ${{ !matrix.cli-only }} # Can't natively run CLI on Github runner's host + if: ${{ inputs.run-tests && !matrix.cli-only }} # Can't natively run CLI on Github runner's host run: $BUILD_CMD test --target=${{ matrix.target }} - name: Run wasm tests - if: ${{ !matrix.use-cross && !matrix.cli-only }} # See comment for the "Build wasm library" step + if: ${{ inputs.run-tests && !matrix.cli-only && !matrix.use-cross }} # See comment for the "Build wasm library" step run: script/test-wasm - name: Run benchmarks - if: ${{ !matrix.use-cross && !matrix.cli-only }} # Cross-compiled benchmarks make no sense + if: ${{ inputs.run-tests && !matrix.cli-only && !matrix.use-cross }} # Cross-compiled benchmarks make no sense run: $BUILD_CMD bench benchmark -p tree-sitter-cli --target=${{ matrix.target }} - name: Upload CLI artifact