Skip to content

Merge upstream feature/distributed-demo into main #242

Merge upstream feature/distributed-demo into main

Merge upstream feature/distributed-demo into main #242

Workflow file for this run

name: React website
on:
push:
paths:
- 'client/**'
- '.github/workflows/client.yml'
pull_request:
paths:
- 'client/**'
- '.github/workflows/client.yml'
workflow_dispatch:
jobs:
client:
name: Test react website
permissions:
contents: read # Required for checking out the code
actions: write # Required for uploading artifacts
strategy:
matrix:
os: [windows-latest, ubuntu-latest]
runs-on: ${{ matrix.os }}
defaults:
run:
working-directory: client/
steps:
- name: Checkout
# v6.0.1
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8
- name: Setup node
# v6.1.0
uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f
with:
node-version: 24
cache: "yarn"
cache-dependency-path: "**/yarn.lock"
- name: Install dependencies
run: |
yarn install --network-timeout 1000000
yarn playwright install --with-deps
- name: Run the linting checks
run: |
yarn syntax
- name: Build the React SPA website and setup env
run: |
yarn build
yarn config:test
- name: Run client unit and integration tests
run: |
yarn test:int
yarn test:unit
yarn test:preview:unit
yarn test:preview:int
yarn test:coverage:int-unit
- name: Upload unit and integration test coverage to Codecov
# v5.5.2
uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
files: client/coverage/all/coverage-final.json
flags: client-unit-integration-tests
- name: Run e2e tests
continue-on-error: true
run: |
yarn test:e2e
- name: Upload Playwright Report (Linux)
# v6.0.0
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f
if: ${{ !cancelled() && runner.os == 'Linux' }}
with:
name: playwright-report-linux
path: client/playwright-report/**
retention-days: 5
- name: Upload Playwright Report (Windows)
# v6.0.0
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f
if: ${{ !cancelled() && runner.os == 'Windows'}}
with:
name: playwright-report-windows
path: client/playwright-report/**
retention-days: 5
- name: Upload e2e test coverage to Codecov
# v5.5.2
uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de
with:
files: client/coverage/e2e/codecov.json
flags: client-e2e-tests
get-version:
name: Get version
permissions:
contents: read # Required for checking out the code
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
# v6.0.1
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8
- name: Install jq
run: sudo apt-get install -y jq
- name: get version
id: get-version
run: |
version=$(jq -r '.version' ./client/package.json)
echo "version=$version" >> $GITHUB_OUTPUT
outputs:
version: ${{ steps.get-version.outputs.version }}
publish-docker-image-ghcr:
permissions:
contents: read # Required for checking out the code
packages: write # Push to github package registry
if: |
github.event_name == 'push' &&
(
startsWith(github.ref, 'refs/heads/feature/') ||
startsWith(github.ref, 'refs/heads/release-v')
)
name: Publish Docker image (GHCR)
needs: [client, get-version]
uses: ./.github/workflows/docker-ghcr.yml
with:
image-name: dtaas-web
version: ${{ needs.get-version.outputs.version }}
dockerfile: client.built.dockerfile
secrets: inherit
publish-docker-image-dockerhub:
permissions:
contents: read # Required for checking out the code
packages: write # Required for publishing to github package registry
if: |
github.event_name == 'push' &&
(
startsWith(github.ref, 'refs/heads/feature/') ||
startsWith(github.ref, 'refs/heads/release-v')
)
name: Publish Docker image (DockerHub)
needs: [client, get-version]
uses: ./.github/workflows/docker-dockerhub.yml
with:
image-name: dtaas-web
version: ${{ needs.get-version.outputs.version }}
dockerfile: client.built.dockerfile
readme-file: client/DOCKER.md
secrets:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_SCOPE: ${{ secrets.DOCKERHUB_SCOPE }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}