ethanneff/example

View on GitHub
.github/workflows/validate-code.yml

Summary

Maintainability
Test Coverage
name: Validate Code

on:
  push:
    branches: [master]
  pull_request:
    branches: [master]

concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}

jobs:
  validate-code:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v3
        with:
          fetch-depth: 0

      - name: Setup node
        uses: actions/setup-node@v3
        with:
          node-version: 20
          cache: 'yarn'

      - name: Install node dependencies
        run: yarn ci-install

      - name: Run code dupe
        run: yarn ci-dupe-code

      - name: Run code unused
        run: yarn ci-unused-code

      - name: Run lint
        run: yarn ci-lint

      - name: Run tests
        run: yarn ci-test