From 5a9d3cfc70c62589fbf28a61a9ae2db542a945b0 Mon Sep 17 00:00:00 2001 From: Marko Date: Wed, 29 Apr 2020 16:39:49 +0200 Subject: [PATCH] run diff in each job (#6094) --- .github/workflows/sims.yml | 68 +++++++++++++++++++++++++------------- 1 file changed, 45 insertions(+), 23 deletions(-) diff --git a/.github/workflows/sims.yml b/.github/workflows/sims.yml index 5faefe9d9..ea7c3e377 100644 --- a/.github/workflows/sims.yml +++ b/.github/workflows/sims.yml @@ -1,24 +1,6 @@ name: Sims on: [pull_request] jobs: - diff: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: technote-space/get-diff-action@v1 - id: git_diff - with: - SUFFIX_FILTER: | - .go - .mod - .sum - SET_ENV_NAME_INSERTIONS: 1 - SET_ENV_NAME_LINES: 1 - - name: Fail if no changes - # this is used to notify the other jobs that there are no changes and so they should not run - run: exit 1 - if: "env.GIT_DIFF == ''" - cleanup-runs: runs-on: ubuntu-latest if: "!startsWith(github.ref, 'refs/tags/') && github.ref != 'refs/heads/master'" @@ -37,7 +19,7 @@ jobs: install-runsim: runs-on: ubuntu-latest - needs: [build, diff] + needs: build steps: - uses: actions/setup-go@v2-beta - name: install runsim @@ -50,52 +32,92 @@ jobs: test-sim-nondeterminism: runs-on: ubuntu-latest - needs: [build, install-runsim, diff] + needs: [build, install-runsim] steps: - uses: actions/checkout@v2 + - uses: technote-space/get-diff-action@v1 + with: + SUFFIX_FILTER: | + .go + .mod + .sum + SET_ENV_NAME_INSERTIONS: 1 + SET_ENV_NAME_LINES: 1 - uses: actions/cache@v1 with: path: ~/go/bin key: ${{ runner.os }}-go-runsim-binary + if: "env.GIT_DIFF != ''" - name: test-sim-nondeterminism run: | make test-sim-nondeterminism + if: "env.GIT_DIFF != ''" test-sim-import-export: runs-on: ubuntu-latest - needs: [build, install-runsim, diff] + needs: [build, install-runsim] steps: - uses: actions/checkout@v2 + - uses: technote-space/get-diff-action@v1 + with: + SUFFIX_FILTER: | + .go + .mod + .sum + SET_ENV_NAME_INSERTIONS: 1 + SET_ENV_NAME_LINES: 1 - uses: actions/cache@v1 with: path: ~/go/bin key: ${{ runner.os }}-go-runsim-binary + if: "env.GIT_DIFF != ''" - name: test-sim-import-export run: | make test-sim-import-export + if: "env.GIT_DIFF != ''" test-sim-after-import: runs-on: ubuntu-latest - needs: [build, install-runsim, diff] + needs: [build, install-runsim] steps: - uses: actions/checkout@v2 + - uses: technote-space/get-diff-action@v1 + with: + SUFFIX_FILTER: | + .go + .mod + .sum + SET_ENV_NAME_INSERTIONS: 1 + SET_ENV_NAME_LINES: 1 - uses: actions/cache@v1 with: path: ~/go/bin key: ${{ runner.os }}-go-runsim-binary + if: "env.GIT_DIFF != ''" - name: test-sim-after-import run: | make test-sim-after-import + if: "env.GIT_DIFF != ''" test-sim-multi-seed-short: runs-on: ubuntu-latest - needs: [build, install-runsim, diff] + needs: [build, install-runsim] steps: - uses: actions/checkout@v2 + - uses: technote-space/get-diff-action@v1 + with: + SUFFIX_FILTER: | + .go + .mod + .sum + SET_ENV_NAME_INSERTIONS: 1 + SET_ENV_NAME_LINES: 1 - uses: actions/cache@v1 with: path: ~/go/bin key: ${{ runner.os }}-go-runsim-binary + if: "env.GIT_DIFF != ''" - name: test-sim-multi-seed-short run: | make test-sim-multi-seed-short + if: "env.GIT_DIFF != ''"