Skip to content

Commit

Permalink
chore: improve CI to run playwright tests in parallel
Browse files Browse the repository at this point in the history
  • Loading branch information
xmatthias committed Jan 25, 2025
1 parent 3690492 commit 18d28ae
Showing 1 changed file with 46 additions and 14 deletions.
60 changes: 46 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,50 +51,82 @@ jobs:
- name: Build build
run: pnpm run build

- name: Archive artifacts
- name: Archive build artifacts
uses: actions/upload-artifact@v4
# Ideally this would upload the zip file from below - but this action currently does not support this.
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 }}
path: |
dist
!dist/**/*.map
retention-days: 10

# Playwright section
- name: Install Playwright Browsers
run: pnpm exec playwright install --with-deps

- name: Run Playwright tests
run: pnpm exec playwright test
run: pnpm exec playwright test --shard ${{ matrix.shardIndex }}/3

- uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: playwright-report-${{ matrix.node }}
name: playwright-report-shard${{ matrix.shardIndex }}
path: playwright-report/
retention-days: 30

# End Playwright section
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
if: github.event_name == 'release' && matrix.node == '22'
run: |
cd dist/
zip -r ../freqUI.zip .
cd ../
- name: Upload release binaries
uses: alexellis/[email protected]
if: github.event_name == 'release' && matrix.node == '22'
env:
GITHUB_TOKEN: ${{ github.token }}
with:
asset_paths: '["./freqUI.zip"]'

call-docker-workflow:
needs: build
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:
Expand Down

0 comments on commit 18d28ae

Please sign in to comment.