Skip to content
This repository has been archived by the owner on Oct 16, 2024. It is now read-only.

feat: recommended config #81

feat: recommended config

feat: recommended config #81

Workflow file for this run

name: Test Workflow
on:
# Triggers the workflow on push events
push:
# Triggers the workflow on pull request events
pull_request:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
permissions:
contents: read
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- name: 'Format check'
cmd: 'npm run format:check'
- name: 'Unit tests'
cmd: 'npm run test'
- name: 'Build'
cmd: 'npm run build'
name: '${{ matrix.name }}'
steps:
- uses: actions/setup-node@v3
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: ~/.npm
key: npm-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
npm-node-
- name: Install Deps
run: npm ci --ignore-scripts
- name: ${{ matrix.name }}
run: ${{ matrix.cmd }}
test-bc:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- name: 'Test with Eslint v7'
cmd: |
npm i eslint@^7 \
@typescript-eslint/parser@^4 \
@typescript-eslint/eslint-plugin@^4
cat package-lock.json | grep -A 1 \
-e "\"node_modules/eslint\": {" \
-e "\"node_modules/@typescript-eslint/parser\": {" \
-e "\"node_modules/@typescript-eslint/eslint-plugin\": {"
test: npm run test
build: npm run build
- name: 'Test with Eslint v6'
cmd: |
npm i eslint@^6 \
@typescript-eslint/parser@^3 \
@typescript-eslint/eslint-plugin@^3
cat package-lock.json | grep -A 1 \
-e "\"node_modules/eslint\": {" \
-e "\"node_modules/@typescript-eslint/parser\": {" \
-e "\"node_modules/@typescript-eslint/eslint-plugin\": {"
test: npm run test
build: npm run build
- name: 'Test with Typescript v4'
cmd: |
npm i typescript@^4
cat package-lock.json | grep -A 1 \
-e "\"node_modules/typescript\": {"
test: npm run test
build: npm run build
- name: 'Test with Typescript v3.7.5'
cmd: |
npm i -D jest@~27.0.0 \
ts-jest@~27.0.0 \
@types/jest@~27.0.0 \
@types/node@^16.0.0 \
@typescript-eslint/[email protected] \
@typescript-eslint/[email protected] \
eslint@~8.0.0 \
--force
npm i [email protected] --force
cat package-lock.json | grep -A 1 \
-e "\"node_modules/typescript\": {" \
-e "\"node_modules/jest\": {" \
-e "\"node_modules/ts-jest\": {"
test: BC_MODE=1 npm run test
build: false
name: '[BC] ${{ matrix.name }}'
steps:
- uses: actions/setup-node@v3
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: ~/.npm
key: npm-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
npm-node-
- name: Install Deps
run: npm ci --ignore-scripts
- name: Install BC deps
run: ${{ matrix.cmd }}
- name: Unit tests
if: matrix.test
run: ${{ matrix.test }}
- name: Build
if: matrix.build
run: ${{ matrix.build }}