Skip to content

Commit

Permalink
ci: Add more conditions to skip CI
Browse files Browse the repository at this point in the history
  • Loading branch information
motss committed Mar 26, 2020
1 parent 4929236 commit 5daf930
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 4 deletions.
23 changes: 21 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,34 @@ on:
- '*'

jobs:
build:
if: "!contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, 'doc:')"
check_ci:
name: ${{ matrix.os }} ${{ matrix.target }}
runs-on: ${{ matrix.os }}
timeout-minutes: 120
strategy:
matrix:
os: [ubuntu-18.04]
target: [13.x]

steps:
- name: Git log
run: |
echo '::set-env name=SKIP_CI::true'
if [ -z "$(git describe --exact-match HEAD)" ] && [ -z git log --format=%B -n 1 | grep -iE '^[0-9]+[.]{1,}[0-9]+[.]{1,}[0-9]+') ]; then
echo '::set-env name=SKIP_CI::false'
fi
test:
if: "env.SKIP_CI == 'false' && !contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, 'doc:')"
name: ${{ matrix.os }} ${{ matrix.target }}
needs: check_ci
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, ubuntu-18.04]
target: [13.x]
timeout-minutes: 120

steps:
- name: Checkout
Expand Down
23 changes: 21 additions & 2 deletions .github/workflows/sauce-labs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ on:
- '*'

jobs:
build:
if: "!contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, 'doc:')"
check_ci:
name: ${{ matrix.os }} ${{ matrix.target }}
runs-on: ${{ matrix.os }}
timeout-minutes: 120
Expand All @@ -23,6 +22,26 @@ jobs:
os: [ubuntu-18.04]
target: [13.x]

steps:
- name: Git log
run: |
echo '::set-env name=SKIP_CI::true'
if [ -z "$(git describe --exact-match HEAD)" ] && [ -z git log --format=%B -n 1 | grep -iE '^[0-9]+[.]{1,}[0-9]+[.]{1,}[0-9]+') ]; then
echo '::set-env name=SKIP_CI::false'
fi
test:
if: "env.SKIP_CI == 'false' && !contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, 'doc:')"
name: ${{ matrix.os }} ${{ matrix.target }}
needs: check_ci
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-18.04]
target: [13.x]
timeout-minutes: 120

steps:
- name: Checkout
uses: actions/checkout@v2
Expand Down

0 comments on commit 5daf930

Please sign in to comment.