Skip to content

ci: Add commitlint and husky pre-push #81 #24

ci: Add commitlint and husky pre-push #81

ci: Add commitlint and husky pre-push #81 #24

Workflow file for this run

name: Tests
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
check_prettier:
#if: "!contains(github.event.head_commit.message, 'Deploying to main')"
name: Prettier Test
runs-on: ubuntu-latest
env:
working-directory: ./
steps:
- uses: actions/checkout@v3
- name: Setup Node.js environment
uses: actions/setup-node@v3
with:
node-version: '18'
- name: Cache root node modules
uses: actions/cache@v3
env:
cache-name: cache-root-node-modules
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install Node
run: npm ci
working-directory: ${{env.working-directory}}
- name: Lint files
run: |
npm run format:check
working-directory: ${{env.working-directory}}
build_test:
#if: "!contains(github.event.head_commit.message, 'Deploying to main')"
name: Test
runs-on: ubuntu-latest
env:
working-directory: ./
steps:
- uses: actions/checkout@v3
- name: Setup Node.js environment
uses: actions/setup-node@v3
with:
node-version: '18'
- name: Cache node modules
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install Node
run: npm ci
working-directory: ${{env.working-directory}}
- name: Test and Linter
env:
NODE_OPTIONS: "--max_old_space_size=4096"
run: |
npm run test
npm run lint
working-directory: ${{env.working-directory}}
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: coverage
path: ./dist/