-
-
Notifications
You must be signed in to change notification settings - Fork 296
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: improve CI to run playwright tests in parallel
- Loading branch information
Showing
1 changed file
with
46 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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: | ||
|