Skip to content
Merged
Show file tree
Hide file tree
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
79 changes: 79 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: CI

on:
pull_request:
types: [opened, synchronize, reopened]

env:
NODE_VERSION: "12.x"

jobs:
setup:
name: Setup
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v2

- uses: actions/setup-node@v1
with:
node-version: "${{ env.NODE_VERSION }}"

- name: Cache node modules
id: cache
uses: actions/cache@v1
with:
path: node_modules
key: ${{ runner.os }}-node_modules-${{ hashFiles('**/package-lock.json') }}

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

eslint:
name: Eslint
runs-on: ubuntu-latest
needs: [setup]
timeout-minutes: 5
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0

- uses: actions/setup-node@v1
with:
node-version: "${{ env.NODE_VERSION }}"

- name: Fetch all branches
run: |
git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/*

- name: Cache node modules
uses: actions/cache@v1
with:
path: node_modules
key: ${{ runner.os }}-node_modules-${{ hashFiles('**/package-lock.json') }}

- name: Run Eslint
run: npm run ci:lint -- $(git diff --diff-filter d --name-only origin/${{ github.base_ref }}...HEAD -- '*.js' '*.ts' '*.tsx')

tests:
name: Tests
runs-on: ubuntu-latest
needs: [setup]
timeout-minutes: 5
steps:
- uses: actions/checkout@v2

- uses: actions/setup-node@v1
with:
node-version: "${{ env.NODE_VERSION }}"

- name: Cache node modules
uses: actions/cache@v1
with:
path: node_modules
key: ${{ runner.os }}-node_modules-${{ hashFiles('**/package-lock.json') }}

- name: Run Tests
run: npm run ci:test
39 changes: 0 additions & 39 deletions .github/workflows/lint.yml

This file was deleted.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"lint": "eslint 'src/**/*.js' --quiet --fix",
"clean": "rimraf ./dist ./.cache",
"ci:lint": "eslint 'src/**/*.js' -c ./.eslintrc.js",
"ci:test": "jest --ci" ,
"test": "jest",
"test:watch": "jest --watch"
},
Expand Down