chore: add ci checks, order fields, fix types, and simplify logic #30
Workflow file for this run
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
--- | |
# docs at: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions | |
name: CI | |
on: [push, pull_request] | |
jobs: | |
run-eslint: | |
name: Lint source files with ESLint | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
- run: npm ci | |
- name: Run ESLint | |
run: > | |
npx eslint | |
. | |
--config | |
.eslintrc.yaml | |
--ignore-path | |
.eslintignore | |
run-prettier: | |
name: Lint source files with Prettier | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
- run: npm ci | |
- run: > | |
npx prettier --check | |
. | |
--config | |
.prettierrc.yaml | |
--ignore-path | |
.prettierignore | |
run-npm-audit: | |
name: Scan for known vulnerabilities in dependencies with npm audit | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
- run: npm ci | |
- run: > | |
npm audit | |
--audit-level | |
critical | |
run-npm-depcheck: | |
name: Check for unused and missing dependencies with depcheck | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
- run: npm ci | |
- run: > | |
npx depcheck | |
--ignores | |
typescript,prettier | |
run-npm-outdated: | |
name: Check for outdated packages with npm outdated and npm-check-updates | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
- run: npm ci | |
- run: npm outdated | |
- run: npx npm-check-updates | |
typos_spell_check: | |
name: Spell Check with Typos | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Check spelling with typos | |
uses: crate-ci/typos@master | |
with: | |
config: .typos.toml | |
commitlint: | |
name: Check the commit conforms to the Conventional Commits specification with commitlint | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: wagoid/commitlint-github-action@v5 | |
# TODO: check commits squashed into one (i.e. all changes in a PR are in one commit after last one in primary branch) | |
# TODO: use release-please to increment version number, update changelog, and publish releases automatically if CI passes | |
# TODO: check project builds/compiles correctly | |
# TODO: add tests including coverage |