diff --git a/.github/workflows/test-unit.yaml b/.github/workflows/test-unit.yaml index 36721ba85..43ea42853 100644 --- a/.github/workflows/test-unit.yaml +++ b/.github/workflows/test-unit.yaml @@ -29,3 +29,24 @@ jobs: - name: Tests run: make test-unit + + test-ui-unit: + runs-on: ubuntu-latest + + steps: + - name: Check out code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Set up Node.js ${{ env.NODE_VERSION }} + uses: actions/setup-node@v4 + with: + node-version-file: webui/.nvmrc + cache: 'yarn' + cache-dependency-path: webui/yarn.lock + + - name: UI unit tests + run: | + yarn --cwd webui install + yarn --cwd webui test:unit:ci diff --git a/Makefile b/Makefile index 7a810fff8..9204814ab 100644 --- a/Makefile +++ b/Makefile @@ -88,7 +88,7 @@ crossbinary-default: generate generate-webui .PHONY: test #? test: Run the unit and integration tests -test: test-unit test-integration +test: test-ui-unit test-unit test-integration .PHONY: test-unit #? test-unit: Run the unit tests @@ -100,6 +100,13 @@ test-unit: test-integration: binary GOOS=$(GOOS) GOARCH=$(GOARCH) go test ./integration -test.timeout=20m -failfast -v $(TESTFLAGS) +.PHONY: test-ui-unit +#? test-ui-unit: Run the unit tests for the webui +test-ui-unit: + $(MAKE) build-webui-image + docker run --rm -v "$(PWD)/webui/static":'/src/webui/static' traefik-webui yarn --cwd webui install + docker run --rm -v "$(PWD)/webui/static":'/src/webui/static' traefik-webui yarn --cwd webui test:unit:ci + .PHONY: pull-images #? pull-images: Pull all Docker images to avoid timeout during integration tests pull-images: