diff --git a/.github/workflows/deploy-frontend.yml b/.github/workflows/deploy-frontend.yml index e138972..eddeaf9 100644 --- a/.github/workflows/deploy-frontend.yml +++ b/.github/workflows/deploy-frontend.yml @@ -20,7 +20,30 @@ concurrency: cancel-in-progress: true jobs: + # The release gate (unit test plan, 26 November): a failing unit test or + # lint error stops the deploy. Node 22, since `npm test` passes a glob to + # `node --test`, which Node 20 does not expand. + test: + runs-on: ubuntu-latest + defaults: + run: + working-directory: topologicpy-web-frontend + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: '22' + cache: 'npm' + cache-dependency-path: topologicpy-web-frontend/package-lock.json + - name: Install + run: npm ci + - name: Unit tests + run: npm test + - name: Lint + run: npm run lint + build: + needs: test runs-on: ubuntu-latest defaults: run: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..cbab577 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,41 @@ +name: Tests + +# The pull-request level of the release gate (unit test plan, 26 November): +# unit tests, lint and a build on every pull request into main. A red run +# should block the merge. +on: + pull_request: + branches: [main] + paths: + - 'topologicpy-web-frontend/**' + - '.github/workflows/**' + workflow_dispatch: + +permissions: + contents: read + +concurrency: + group: tests-${{ github.ref }} + cancel-in-progress: true + +jobs: + test: + runs-on: ubuntu-latest + defaults: + run: + working-directory: topologicpy-web-frontend + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: '22' + cache: 'npm' + cache-dependency-path: topologicpy-web-frontend/package-lock.json + - name: Install + run: npm ci + - name: Unit tests + run: npm test + - name: Lint + run: npm run lint + - name: Build + run: npm run build