72673970c0
* refactor: parametrize cwd * test: set up helpers and validate * refactor: remove mocks from tests * ci: bump node * build: bump node * refactor: extract utils, hoist cwd up * test: cov utils
70 lines
1.5 KiB
YAML
70 lines
1.5 KiB
YAML
name: packwatch CI
|
|
|
|
on: [push, pull_request]
|
|
|
|
jobs:
|
|
lint:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- name: Use Node.js 12.x
|
|
uses: actions/setup-node@v1
|
|
with:
|
|
node-version: 12.x
|
|
- run: yarn
|
|
- run: yarn lint
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
matrix:
|
|
node-version: [12.x, 14.x]
|
|
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- name: Use Node.js ${{ matrix.node-version }}
|
|
uses: actions/setup-node@v1
|
|
with:
|
|
node-version: ${{ matrix.node-version }}
|
|
- run: yarn
|
|
- run: yarn test:coverage
|
|
- name: Coverage
|
|
uses: codecov/codecov-action@v1
|
|
with:
|
|
token: ${{ secrets.CODECOV_TOKEN }}
|
|
fail_ci_if_error: false
|
|
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
node-version: [12.x, 14.x]
|
|
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- name: Use Node.js ${{ matrix.node-version }}
|
|
uses: actions/setup-node@v1
|
|
with:
|
|
node-version: ${{ matrix.node-version }}
|
|
- run: yarn --immutable
|
|
- run: yarn build
|
|
release:
|
|
name: Release
|
|
runs-on: ubuntu-latest
|
|
needs: [build, lint, test]
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v1
|
|
- name: Node setup
|
|
uses: actions/setup-node@v1
|
|
with:
|
|
node-version: 14
|
|
- name: Prepare
|
|
run: yarn && yarn build
|
|
- name: Release
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
|
|
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
run: yarn semantic-release
|
|
|