Skip to content

fix: error with pretty-print and jest #466

fix: error with pretty-print and jest

fix: error with pretty-print and jest #466

Workflow file for this run

name: CI
on:
pull_request:
branches: [main]
paths-ignore:
- .gitignore
- LICENSE
- README.md
- .github/dependabot.yml
- .github/workflows/deploy.yml
- .github/workflows/bump.yml
env:
node_version: "18.x"
jobs:
test:
name: Test Module
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x, 18.x]
fail-fast: false
steps:
- uses: actions/checkout@v3
- name: Set up Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: npm install
run: npm install
- name: npm test
run: npm run test
- name: npm test with coverage
if: ${{ matrix.node-version == env.node_version }} # just run coverage if node 16
run: npm run coverage
- name: Upload coverage to Codecov
if: ${{ matrix.node-version == env.node_version }} # just run coverage if node 16
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
lint:
name: Lint Module
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ env.node_version }}
- name: npm install
run: npm install
- name: npm lint
run: npm run lint
# https://github.com/marketplace/actions/release-drafter
draft_release:
name: Draft Release
runs-on: ubuntu-latest
needs: [test, lint]
steps:
- uses: actions/checkout@v3
- id: version
run: echo ::set-output name=version::$(node -p 'require("./package.json").version')
- name: Draft release
id: draft
uses: release-drafter/release-drafter@v5
with:
version: ${{ steps.version.outputs.version }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Link to Release
run: |
echo "Release draft create/updated: ${{ steps.draft.outputs.html_url }}"
# ENH: maybe look into adding a comment to the PR with a link to the release draft?