Print stderr when git fails (#15) #72
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Bazel CI | |
on: | |
push: | |
tags: | |
- v* | |
branches: | |
- main | |
pull_request: | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Cache bazel | |
uses: actions/[email protected] | |
env: | |
cache-name: bazel-cache | |
with: | |
path: | | |
~/.cache/bazelisk | |
~/.cache/bazel | |
key: ${{ runner.os }}-${{ env.cache-name }} | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
# You won't do this in your build since you will likely use a prebuilt bazel-differ binary, but we | |
# need to bootstrap | |
- name: build | |
run: bazel build //cli:bazel-differ | |
- name: set bazel differ path | |
run: echo "BAZEL_DIFFER=$(bazel info bazel-bin)/cli/bazel-differ_/bazel-differ" >> $GITHUB_ENV | |
# This section starts an example of how to use get-targets in your CI process | |
- name: Get revisions | |
id: get-revisions | |
run: GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} ./tools/diff-sha.sh | |
- name: get-test-targets | |
run: $BAZEL_DIFFER get-targets -s ${{ steps.get-revisions.outputs.previous_sha }} -f ${{ steps.get-revisions.outputs.current_sha }} -o test_targets.txt -v --output-on-empty=false | |
- name: run-test-targets | |
if: hashFiles('test_targets.txt') != '' | |
run: bazel test --target_pattern_file=test_targets.txt | |
- name: get-build-targets | |
run: $BAZEL_DIFFER get-targets -s ${{ steps.get-revisions.outputs.previous_sha }} -f ${{ steps.get-revisions.outputs.current_sha }} -o build_targets.txt -v --output-on-empty=false | |
- name: run-build-targets | |
if: hashFiles('build_targets.txt') != '' | |
run: bazel build --target_pattern_file=build_targets.txt | |
# Run tests | |
- name: gazelle check | |
run: bazel run //:gazelle_ci | |
- name: build bazel-diff | |
run: bazel build //tools/bazel-diff/... | |
- name: compatibility tests | |
run: ./test.sh |