Skip to content

Commit

Permalink
temp: print command
Browse files Browse the repository at this point in the history
  • Loading branch information
ObserverOfTime committed Mar 26, 2024
1 parent 37b350c commit eec0d42
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -158,16 +158,24 @@ jobs:

- name: Run main tests
if: ${{ !matrix.cli-only && inputs.run_test }} # Can't natively run CLI on Github runner's host
continue-on-error: true
run: $BUILD_CMD test --target=${{ matrix.target }} --features=${{ matrix.cli_features }}

- name: Run wasm tests
if: ${{ !matrix.cli-only && !matrix.use-cross && inputs.run_test }} # See comment for the "Build wasm library" step
continue-on-error: true
run: script/test-wasm

- name: Run benchmarks
if: ${{ !matrix.cli-only && !matrix.use-cross && inputs.run_test }} # Cross-compiled benchmarks make no sense
run: $BUILD_CMD bench benchmark -p tree-sitter-cli --target=${{ matrix.target }}

- if: matrix.platform != 'windows-arm64'
run: $BUILD_CMD run --release --target=${{ matrix.target }} build test/fixtures/grammars/bash
env:
PRINT_COMMAND: "1"
MACOSX_DEPLOYMENT_TARGET: "10.13"

- name: Upload CLI artifact
uses: actions/upload-artifact@v4
with:
Expand Down
3 changes: 3 additions & 0 deletions cli/loader/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -604,6 +604,9 @@ impl Loader {
command.args(cc_config.get_files());
command.arg("-o").arg(output_path);
}
if option_env!("PRINT_COMMAND").is_some() {
println!("::notice title=Command ({BUILD_TARGET})::{command:?}");
}

let output = command.output().with_context(|| {
format!("Failed to execute the C compiler with the following command:\n{command:?}")
Expand Down

0 comments on commit eec0d42

Please sign in to comment.