Skip to content

Commit

Permalink
Improve Github Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
lydell committed Nov 29, 2020
1 parent 80463a4 commit 35b6915
Show file tree
Hide file tree
Showing 4 changed files with 84 additions and 39 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Check

on:
push:
branches:
- "master"
pull_request:

jobs:
main:
runs-on: ubuntu-latest

strategy:
matrix:
os: [ubuntu-latest]
node-version: [15.x]

steps:
- uses: actions/checkout@v2

- uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}

- name: Cache node_modules
id: cache-node_modules
uses: actions/cache@v2
with:
path: node_modules
key: node_modules-${{ matrix.os }}-${{ matrix.node-version }}-${{ hashFiles('package-lock.json') }}

- name: npm ci
if: steps.cache-node_modules.outputs.cache-hit != 'true'
run: npm ci

- name: ESLint
run: npx --no-install eslint .

- name: Prettier
run: npx --no-install prettier --check .
39 changes: 0 additions & 39 deletions .github/workflows/ci.yml

This file was deleted.

43 changes: 43 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Test

on:
push:
branches:
- "master"
pull_request:

jobs:
main:
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
node-version: [10.x, 12.x, 14.x, 15.x]

steps:
- uses: actions/checkout@v2

- uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}

- name: Cache node_modules
id: cache-node_modules
uses: actions/cache@v2
with:
path: node_modules
key: node_modules-${{ matrix.os }}-${{ matrix.node-version }}-${{ hashFiles('package-lock.json') }}

- name: npm ci
if: steps.cache-node_modules.outputs.cache-hit != 'true'
run: npm ci

- name: Jest
run: npx --no-install jest

- name: CLI sanity
run: npm run test:cli-sanity

- name: CLI sanity warning
run: npm run test:cli-sanity-warning
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/test-config/
.vscode

0 comments on commit 35b6915

Please sign in to comment.