name: Validate Monorepo on: pull_request: types: - edited - opened - synchronize workflow_dispatch: jobs: build: runs-on: ubuntu-latest strategy: matrix: node: ['20', '24'] name: Node v${{ matrix.node }} steps: - name: Checkout Commit uses: actions/checkout@v4 with: fetch-depth: 2 - name: Update Master run: | # Ensure the remote-tracking ref exists and is up-to-date without invoking an implicit merge set -euo pipefail # Ensure the remote-tracking ref and local branch ref are up-to-date without invoking an implicit merge DEFAULT_BRANCH="${{ github.event.repository.default_branch }}" git fetch --no-tags --force origin \ "+refs/heads/${DEFAULT_BRANCH}:refs/remotes/origin/${DEFAULT_BRANCH}" \ "+refs/heads/${DEFAULT_BRANCH}:refs/heads/${DEFAULT_BRANCH}" - name: Setup Node uses: actions/setup-node@v3 with: node-version: ${{ matrix.node }} - name: Install PNPM uses: pnpm/action-setup@v4 - name: ESLint Cache uses: actions/cache@v3 with: path: ./.eslintcache key: ${{ runner.os }}-eslintcache-${{ hashFiles('./eslintcache') }} restore-keys: | ${{ runner.os }}-eslintcache- - name: Sanity Check run: | echo git `git version`; echo branch `git branch --show-current`; echo node `node -v`; echo pnpm `pnpm -v` echo `moon --version` - name: pnpm install run: pnpm install --frozen-lockfile - name: Prettier run: pnpm run prettier:check # pnpm audit isn't as robust as it needs to be atm # - name: Audit Dependencies # run: pnpm security - name: Build Packages run: pnpm --recursive build - name: Lint Monorepo run: pnpm lint:js - name: Run Tests run: pnpm --filter "...[origin/master]" ci:coverage