Tests #506
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: Tests | |
on: | |
push: | |
branches: [main, develop] | |
pull_request: | |
branches: [main, develop] | |
schedule: | |
# 00:00 on Saturdays | |
- cron: '0 0 * * SAT' | |
workflow_dispatch: | |
jobs: | |
test: | |
name: Test | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
node-version: [18.x] | |
require-successful-testpack: [true] | |
include: | |
- node-version: 20.x | |
require-successful-testpack: false | |
- node-version: lts/* | |
require-successful-testpack: false | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: '2' | |
- name: Test on Node ${{ matrix.node-version }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- run: yarn | |
- run: npx prettier --check . | |
- run: yarn run build | |
- run: yarn run lint | |
- run: yarn run test | |
- run: npx testpack-cli --keep=@types/*,ts-jest,typescript jest.config.js tsconfig.test.json src/e2e.spec.ts | |
working-directory: ./packages/regex-to-strings | |
# Workaround for #66 | |
continue-on-error: ${{ !matrix.require-successful-testpack }} | |
- name: Upload test coverage report to Codecov | |
uses: codecov/codecov-action@v5.1.2 | |
with: | |
fail_ci_if_error: true | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
- name: Setup Snyk | |
uses: snyk/actions/setup@master | |
id: snyk | |
with: | |
snyk-version: latest | |
- name: Snyk version | |
run: echo "${{ steps.snyk.outputs.version }}" | |
- name: Run Snyk to check for vulnerabilities | |
if: ${{ github.actor != 'dependabot[bot]' }} | |
uses: snyk/actions/node@master | |
env: | |
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }} |