From 1b26e4d113c6e5047cdd8479f3fcccc12e9d7fe1 Mon Sep 17 00:00:00 2001 From: Alan Greene Date: Wed, 11 Dec 2024 18:48:17 +0000 Subject: [PATCH] Update PR workflow to include unit tests job Also includes JS linting, checking the strings are properly extracted for translation, etc. Some of these may be split to separate jobs in future but are kept this way to reuse the existing script responsible for running the unit test job on prow. --- .github/workflows/pr.yml | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index a5eadb013..4bb18c950 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -4,7 +4,6 @@ permissions: contents: read on: - workflow_dispatch: pull_request: branches: ["main"] @@ -50,3 +49,20 @@ jobs: working-directory: ${{ github.workspace }}/src/github.com/tektoncd/dashboard run: | ./test/presubmit-tests.sh --build-tests + + unit-tests: + name: Unit tests + runs-on: ubuntu-24.04 + + steps: + - name: Harden runner + uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2 + with: + egress-policy: audit + + - name: Checkout + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + + - name: Run tests + run: | + ./test/presubmit-tests.sh --unit-tests