Skip to content
Draft
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 31 additions & 3 deletions .github/workflows/test_ui.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
- ".github/workflows/test_ui.yml"

jobs:
test:
checks:
runs-on: artemis-ui-test-runner-4
env:
UI_PATH: ./ui
Expand All @@ -22,6 +22,7 @@
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # actions/setup-node@v4.4.0
with:
node-version-file: "${{ env.UI_PATH }}/.nvmrc"
cache: npm

- uses: hashicorp/setup-terraform@b9cd54a3c349d3f38e8881555d616ced269862dd # hashicorp/setup-terraform@v3.1.2

Expand All @@ -36,10 +37,37 @@
working-directory: ${{ env.UI_PATH }}

- name: Run precommit checks (linting & testing etc)
run: make -C $UI_PATH precommit
run: make -C $UI_PATH lint check audit

tests:
runs-on: artemis-ui-test-runner-4
strategy:
matrix:
shard: [1, 2, 3, 4]
env:
UI_PATH: ./ui
NPM_VERSION: 10
steps:
- name: Checkout the code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # actions/checkout@v4.2.2

- name: Setup node from node version file
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # actions/setup-node@v4.4.0
with:
node-version-file: "${{ env.UI_PATH }}/.nvmrc"
cache: npm

- name: Set up the npm version
run: npm install --global npm@$NPM_VERSION

- name: Install npm packages
run: make -C $UI_PATH install

- name: Run tests
run: make -C $UI_PATH test JESTFLAGS="--shard=${{ matrix.shard }}/${{ strategy.job-total }}"

- name: Save test results
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # actions/upload-artifact@v4.6.2
with:
name: ui-test
path: ui/test-report/index.html
path: ui/test-report-${{ matrix.shard }}/index.html
4 changes: 3 additions & 1 deletion ui/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ ifeq ($(HADOLINT),)
HADOLINT := ${CURDIR}/hadolint
endif
TERRAFORM = terraform
# Additional Jest options.
JESTFLAGS =

APP := artemis-ui
PORT := 3000
Expand Down Expand Up @@ -212,7 +214,7 @@ audit: package.json package-lock.json ## Audit package dependencies for vulnera
.PHONY: test
test: ## Run tests
@echo "${INFO}Running tests"
CI=true $(NPM) test -- --env=jsdom --coverage --silent
CI=true $(NPM) test -- --env=jsdom --coverage --silent $(JESTFLAGS)
@echo "${OK}"

# run coding standards check
Expand Down
Loading