Skip to content

Commit

Permalink
misc(ci): Skip duplicated jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
ovr committed Feb 12, 2021
1 parent 5ef3612 commit a691e1f
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 2 deletions.
39 changes: 38 additions & 1 deletion .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,22 @@ on:
- 'docs/**'

jobs:
pre_job:
# continue-on-error: true # Uncomment once integration is finished
runs-on: ubuntu-latest
# Map a step output to a job output
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
uses: fkirc/skip-duplicate-actions@master
with:
do_not_skip: '["pull_request", "workflow_dispatch", "schedule"]'

unit:
needs: pre_job
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}

runs-on: ubuntu-latest
timeout-minutes: 60

Expand Down Expand Up @@ -85,6 +100,9 @@ jobs:
verbose: true # optional (default = false)

lint:
needs: pre_job
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}

runs-on: ubuntu-latest
timeout-minutes: 60

Expand Down Expand Up @@ -124,6 +142,9 @@ jobs:
run: yarn lerna run --concurrency 1 lint

build:
needs: pre_job
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}

runs-on: ubuntu-latest
timeout-minutes: 60

Expand Down Expand Up @@ -167,6 +188,9 @@ jobs:
run: yarn lerna run --concurrency 1 build

integration-redis:
needs: pre_job
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}

runs-on: ubuntu-latest
timeout-minutes: 60

Expand Down Expand Up @@ -250,6 +274,9 @@ jobs:
CUBEJS_REDIS_SENTINEL: "redis+sentinel://localhost:5000,localhost:5001,localhost:5002/mymaster/0"

integration-wrk-1:
needs: pre_job
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}

runs-on: ubuntu-latest
timeout-minutes: 60

Expand Down Expand Up @@ -347,6 +374,9 @@ jobs:
TEST_MSSQL_VERSION: 2019-latest

integration-wrk-2:
needs: pre_job
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}

runs-on: ubuntu-latest
timeout-minutes: 60

Expand Down Expand Up @@ -435,6 +465,9 @@ jobs:
TEST_CLICKHOUSE_VERSION: 19

integration-wrk-3:
needs: pre_job
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}

runs-on: ubuntu-latest
timeout-minutes: 60

Expand Down Expand Up @@ -510,7 +543,9 @@ jobs:

docker-image-latest-set-tag:
# At least git should be completed pushed up until this moment
needs: integration-wrk-1
needs: pre_job
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}

runs-on: ubuntu-latest
outputs:
tag: ${{ steps.get-tag.outputs.tag }}
Expand Down Expand Up @@ -569,6 +604,8 @@ jobs:
push: false

docker-image-dev:
needs: docker-image-latest-set-tag

name: Build only :dev image
runs-on: ubuntu-latest
timeout-minutes: 60
Expand Down
23 changes: 22 additions & 1 deletion .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,22 @@ on:
- 'rust/**'

jobs:
pre_job:
# continue-on-error: true # Uncomment once integration is finished
runs-on: ubuntu-latest
# Map a step output to a job output
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
uses: fkirc/skip-duplicate-actions@master
with:
do_not_skip: '["pull_request", "workflow_dispatch", "schedule"]'

debian:
needs: pre_job
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}

name: Debian Rust ${{ matrix.rust }}
runs-on: ubuntu-latest
timeout-minutes: 60
Expand Down Expand Up @@ -55,10 +70,13 @@ jobs:
args: --manifest-path rust/Cargo.toml -j 1

docker-image-latest:
needs: pre_job
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}

name: Build only :latest image
runs-on: ubuntu-latest
timeout-minutes: 60
if: github.ref != 'refs/heads/master'

steps:
- name: Checkout
uses: actions/checkout@v2
Expand All @@ -85,6 +103,9 @@ jobs:
cache-to: type=local,dest=/tmp/.buildx-cache

cross:
needs: pre_job
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}

runs-on: ${{ matrix.os }}
timeout-minutes: 60
strategy:
Expand Down

0 comments on commit a691e1f

Please sign in to comment.