Skip to content

Commit

Permalink
ci: Update CI scripts to skip build for version tagging commit
Browse files Browse the repository at this point in the history
  • Loading branch information
motss committed Mar 28, 2020
1 parent 8df67e6 commit 453aa90
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 38 deletions.
35 changes: 16 additions & 19 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,26 +12,10 @@ on:
tags-ignore:
- '*'

jobs:
# env.SKIP_CI == 'true' is not supported at job level
# 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
env:
CI_SKIP: false

jobs:
test:
if: "!contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, 'doc:')"
name: ${{ matrix.os }} ${{ matrix.target }}
Expand All @@ -46,34 +30,47 @@ jobs:
- name: Checkout
uses: actions/checkout@v2

- name: Git log
run: |
if [ -n "$(git log --format=%B -n 1 | grep -iE '^[0-9]+[.]{1,}[0-9]+[.]{1,}[0-9]+')" ]; then
echo '::set-env name=CI_SKIP::true'
fi
- name: Setup node@${{ matrix.target }}
if: "env.CI_SKIP = 'false'"
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.target }}

- name: List versions
if: "env.CI_SKIP = 'false'"
continue-on-error: true
run: |
node -v && npm version && which npm && pwd && npx envinfo
- name: Install dependencies
if: "env.CI_SKIP = 'false'"
run: |
npm ci --quiet
- name: Lint
if: "env.CI_SKIP = 'false'"
run: |
npm run lint
- name: Build
if: "env.CI_SKIP = 'false'"
run: |
npm run build:test && npm run build:config
- name: Check build
if: "env.CI_SKIP = 'false'"
shell: bash
run: |
pwd && ls -la
- name: Run Test
if: "env.CI_SKIP = 'false'"
run: |
npm run test:dev
35 changes: 16 additions & 19 deletions .github/workflows/sauce-labs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,26 +12,10 @@ on:
tags-ignore:
- '*'

jobs:
# env.SKIP_CI == 'true' is not supported at job level
# 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
env:
CI_SKIP: false

jobs:
test:
if: "!contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, 'doc:')"
name: ${{ matrix.os }} ${{ matrix.target }}
Expand All @@ -46,33 +30,46 @@ jobs:
- name: Checkout
uses: actions/checkout@v2

- name: Git log
run: |
if [ -n "$(git log --format=%B -n 1 | grep -iE '^[0-9]+[.]{1,}[0-9]+[.]{1,}[0-9]+')" ]; then
echo '::set-env name=CI_SKIP::true'
fi
- name: Setup node@${{ matrix.target }}
if: "env.CI_SKIP = 'false'"
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.target }}

- name: List versions
if: "env.CI_SKIP = 'false'"
run: |
node -v && npm version && which npm && pwd && npx envinfo
- name: Install dependencies
if: "env.CI_SKIP = 'false'"
run: |
npm ci --quiet
- name: Lint
if: "env.CI_SKIP = 'false'"
run: |
npm run lint
- name: Build
if: "env.CI_SKIP = 'false'"
run: |
npm run build:test && npm run build:config
- name: Check build
if: "env.CI_SKIP = 'false'"
shell: bash
run: |
pwd && ls -la
- name: Run Test
if: "env.CI_SKIP = 'false'"
env:
SAUCE_ACCESS_KEY: ${{ secrets.SAUCE_ACCESS_KEY }}
SAUCE_USERNAME: ${{ secrets.SAUCE_USERNAME }}
Expand Down

0 comments on commit 453aa90

Please sign in to comment.