Merge pull request #245 from elias-oxopia/master #326
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Pipeline | |
on: [push] | |
jobs: | |
all: | |
# Skip CI if a commit contains [skip ci]. Used by semantic release | |
if: "!contains(github.event.head_commit.message, 'skip ci')" | |
name: Node 16 | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up Node.js 16.x | |
uses: actions/setup-node@v2 | |
with: | |
node-version: 16.x # Specify Node.js version 16.x | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Sync packages with cache | |
uses: actions/cache@v1 | |
with: | |
path: ./node_modules | |
key: ${{ runner.os }}-node_modules-${{ hashFiles('**/yarn.lock') }} | |
restore-keys: ${{ runner.os }}-node_modules- | |
- name: Install packages | |
run: yarn install --frozen-lockfile | |
- name: Run ESLint | |
run: yarn lint --quiet --color | |
- name: Run tests | |
id: tests | |
run: yarn run test --watchAll=false --colors --ci --coverage | |
- name: Compile src | |
run: yarn build | |
- name: Build the docs | |
run: yarn document | |
- name: Upload coverage report to codecov | |
uses: codecov/codecov-action@v1 | |
- name: Deploy docs | |
if: github.ref == 'refs/heads/master' | |
uses: crazy-max/ghaction-github-pages@v1 | |
with: | |
target_branch: gh-pages | |
build_dir: docs | |
env: | |
GITHUB_PAT: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }} | |
- name: Release to NPM | |
if: github.ref == 'refs/heads/master' | |
run: yarn release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |