Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: Merge code-health job to test job #48

Merged
merged 1 commit into from
Jan 13, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 18 additions & 44 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,65 +1,27 @@
name: 'Test'

on:
push:
branches:
- master
paths-ignore:
- '**.md'
pull_request:
types:
- opened
- synchronize
paths-ignore:
- '**.md'
push:
paths-ignore:
- '**.md'
branches:
- master

jobs:
skipci:
runs-on: ubuntu-18.04
steps:
- run: echo "[Skip CI] ${{ contains(github.event.head_commit.message, '[skip ci]') }}"

code-health:
runs-on: ubuntu-18.04
if: contains(github.event.head_commit.message, '[skip ci]') == false
steps:

- uses: actions/checkout@v2

- name: Read .nvmrc
run: echo "::set-output name=NVMRC::$(cat .nvmrc)"
id: nvm

- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: '${{ steps.nvm.outputs.NVMRC }}'

- name: Get npm cache directory
id: npm-cache
run: |
echo "::set-output name=dir::$(npm config get cache)"

- name: Cache npm
uses: actions/cache@v1
with:
path: ${{ steps.npm-cache.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-

- run: npm ci

- run: npm run format:check

- run: npm run lint

- run: npm run build


test:
runs-on: ${{ matrix.os }}
needs: code-health
if: contains(github.event.head_commit.message, '[skip ci]') == false
strategy:
matrix:
os:
Expand Down Expand Up @@ -94,6 +56,18 @@ jobs:

- run: npm ci

- name: Run prettier
if: startsWith(matrix.os, 'ubuntu')
run: npm run format:check

- name: Run eslint
if: startsWith(matrix.os, 'ubuntu')
run: npm run lint

- name: Run ncc
if: startsWith(matrix.os, 'ubuntu')
run: npm run build

- run: npm test

- name: Upload test coverage as artifact
Expand Down