feat(NOD-384): support help option + refactor based on tests #11
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: CI | |
on: | |
pull_request: | |
types: [opened, synchronize, reopened] | |
jobs: | |
build: | |
name: Build, Test and Publish | |
timeout-minutes: 15 | |
permissions: | |
contents: read | |
packages: write | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: ['ubuntu-latest'] | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 2 | |
- run: echo "node_version=$(cat .node-version)" >> $GITHUB_ENV | |
- name: 'use node ${{ env.node_version }}' | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '${{ env.node_version }}' | |
cache: 'yarn' | |
registry-url: 'https://npm.pkg.github.com' | |
# Defaults to the user or organization that owns the workflow file | |
scope: '@okeeffed' | |
- name: Get yarn cache directory path | |
id: yarn-cache-dir-path | |
run: echo "::set-output name=dir::$(yarn cache dir)" | |
- uses: actions/cache@v2 | |
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) | |
with: | |
path: ${{ steps.yarn-cache-dir-path.outputs.dir }} | |
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | |
restore-keys: | | |
${{ runner.os }}-yarn- | |
- name: Install dependencies | |
run: yarn install --immutable | |
if: steps.yarn-cache.outputs.cache-hit != 'true' | |
- name: Run Prod Dependency Audit | |
run: yarn npm audit --recursive --environment production --all | |
- name: Run Dev Dependency Audit | |
run: yarn npm audit --environment development | |
continue-on-error: true | |
- name: Lint check | |
run: yarn lint | |
- name: Type check | |
run: yarn type-check | |
env: | |
NODE_OPTIONS: '--max_old_space_size=4096' | |
- name: Test | |
run: yarn test | |
- name: Check build | |
run: yarn build |