From 10f02e576fbb03f71e73b88fbf78bfed2f62bfb5 Mon Sep 17 00:00:00 2001 From: "C. Fuhrman" Date: Sun, 2 Feb 2025 15:31:16 -0500 Subject: [PATCH] clean up tests action --- .github/workflows/tests.yml | 56 ++++++++++++++++++++++--------------- 1 file changed, 34 insertions(+), 22 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d916699..474ae36 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -9,28 +9,40 @@ on: - main jobs: - tests: - runs-on: ubuntu-latest - - steps: - - name: Check Out Repo - uses: actions/checkout@v4 - - - name: Set up Node.js - uses: actions/setup-node@v4 - with: - node-version: '20' - - - name: Install Dependencies, lint and Run Tests - run: | - echo "Installing dependencies..." - npm ci - echo "Running ESLint..." - npx eslint . - echo "Running tests..." - npm test - working-directory: ${{ matrix.directory }} - + lint-and-tests: strategy: matrix: directory: [client, server] + fail-fast: false + + runs-on: ubuntu-latest + timeout-minutes: 10 + + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 + with: + node-version: '20' + cache: 'npm' + cache-dependency-path: ${{ matrix.directory }}/package-lock.json + + - name: Process ${{ matrix.directory }} + working-directory: ${{ matrix.directory }} + timeout-minutes: 5 + run: | + echo "::group::Installing dependencies for ${{ matrix.directory }}" + npm ci + echo "::endgroup::" + + echo "::group::Running ESLint" + npx eslint . || { + echo "ESLint failed with exit code $?" + exit 1 + } + echo "::endgroup::" + + echo "::group::Running Tests" + npm test + echo "::endgroup::" +