Skip to content

chore: improve CI to run playwright tests in parallel #6464

chore: improve CI to run playwright tests in parallel

chore: improve CI to run playwright tests in parallel #6464

Workflow file for this run

name: FreqUI CI
on:
push:
branches:
- main
- ci/**
pull_request:
branches:
- main
release:
types: [ published ]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-22.04 ]
node: [ "18", "20", "22", "23"]
steps:
- uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
cache: 'pnpm'
- run: pnpm install
- name: Run Lint
run: pnpm run lint-ci
- name: Run type check
run: pnpm run typecheck
- name: Run Tests
run: pnpm run test:unit
- name: Build build
run: pnpm run build
- name: Archive build artifacts
uses: actions/upload-artifact@v4
with:
name: build-artifacts-${{ matrix.node }}
path: dist
retention-days: 1
playwright:
needs: build
runs-on: ubuntu-22.04
strategy:
matrix:
node: [ "18", "20", "22", "23"]
shardIndex: [1, 2, 3]
fail-fast: false
steps:
- uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
cache: 'pnpm'
- run: pnpm install
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
path: ./dist/
name: freqUI-${{ matrix.node }}
- name: Install Playwright Browsers
run: pnpm exec playwright install --with-deps
- name: Run Playwright tests
run: pnpm exec playwright test --shard ${{ matrix.shardIndex }}/3
- uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: playwright-report-shard${{ matrix.shardIndex }}
path: playwright-report/
retention-days: 30
release-artifacts:
if: github.event_name == 'release'
needs: [build, playwright]
runs-on: ubuntu-22.04
steps:
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
path: ./dist/
# Use node-22 build.
name: freqUI-22
- name: Zip files for release
run: |
cd dist/
zip -r ../freqUI.zip .
cd ../
- name: Upload release binaries
uses: alexellis/[email protected]
env:
GITHUB_TOKEN: ${{ github.token }}
with:
asset_paths: '["./freqUI.zip"]'
call-docker-workflow:
needs: [build, playwright]
if: (github.event_name == 'push' || github.event_name == 'schedule' || github.event_name == 'release') && github.repository == 'freqtrade/frequi'
uses: ./.github/workflows/docker.yml
secrets:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}