diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 492237b0..f7c0e402 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -1,5 +1,8 @@ name: Tests -on: [push, pull_request] +on: + push: + pull_request: + types: [opened, synchronize, reopened, edited] jobs: ubuntu_test: name: Ubuntu tests @@ -30,14 +33,15 @@ jobs: if [ -n "${{ github.base_ref }}" ]; then CHANGED_OUTPUTS=$(echo "${{ github.event.pull_request.body }}" | sed -n 's/.*CHANGED_OUTPUTS=\([^ ]*\).*/\1/p') - BASE_BRANCH="${{ github.base_ref }}" - HEAD_BRANCH="${{ github.head_ref || github.ref_name }}" + BASE_REF="${{ github.base_ref }}" + HEAD_REF=$(git rev-parse HEAD) + echo "CHANGED_OUTPUTS: $CHANGED_OUTPUTS" - git fetch origin $BASE_BRANCH - git checkout $BASE_BRANCH + git fetch origin $BASE_REF + git checkout $BASE_REF ./cargo_util.py --make_golden_outputs - git checkout $HEAD_BRANCH - ./cargo_util.py --test_outputs --ignore_new_outputs --changed_outputs $CHANGED_OUTPUTS + git checkout $HEAD_REF + ./cargo_util.py --test_outputs --ignore_new_outputs --changed_outputs=$CHANGED_OUTPUTS fi - name: Upload golden outputs if: ${{ always() }}