Skip to content

Commit

Permalink
add gha action for playwright
Browse files Browse the repository at this point in the history
  • Loading branch information
jiridanek committed Oct 27, 2024
1 parent efc51b3 commit a87acd7
Showing 1 changed file with 25 additions and 2 deletions.
27 changes: 25 additions & 2 deletions .github/workflows/build-notebooks-TEMPLATE.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ jobs:
if: "${{ fromJson(inputs.github).event_name == 'pull_request' }}"
env:
IMAGE_TAG: "${{ github.sha }}"
IMAGE_REGISTRY: "localhost:5000/workbench-images"
IMAGE_REGISTRY: "ghcr.io/${{ github.repository }}/workbench-images"
CONTAINER_BUILD_CACHE_ARGS: "--cache-from ${{ env.CACHE }}"
# We don't have access to image registry, so disable pushing
PUSH_IMAGES: "no"
Expand All @@ -155,7 +155,7 @@ jobs:
TARGET="$FS_SCAN_FOLDER"
TYPE="fs"
else
TARGET="localhost:5000/workbench-images:${{ inputs.target }}-${{ github.sha }}"
TARGET="ghcr.io/${{ github.repository }}/workbench-images:${{ inputs.target }}-${{ github.sha }}"
TYPE="image"
fi
elif [[ "$EVENT_NAME" == "schedule" ]]; then
Expand Down Expand Up @@ -215,5 +215,28 @@ jobs:
cat $REPORT_FOLDER/$REPORT_FILE >> $GITHUB_STEP_SUMMARY
- uses: actions/setup-node@v4
if: ${{ fromJson(inputs.github).event_name == 'pull_request' && contains(inputs.target, 'codeserver') }}
with:
node-version: lts/*
- name: Install dependencies
if: ${{ fromJson(inputs.github).event_name == 'pull_request' && contains(inputs.target, 'codeserver') }}
run: npm install -g pnpm && pnpm install
- name: Install Playwright Browsers
if: ${{ fromJson(inputs.github).event_name == 'pull_request' && contains(inputs.target, 'codeserver') }}
run: pnpm exec playwright install --with-deps
- name: Run Playwright tests
if: ${{ fromJson(inputs.github).event_name == 'pull_request' && contains(inputs.target, 'codeserver') }}
run: pnpm exec playwright test
working-directory: codeserver/e2e
env:
TEST_TARGET: "ghcr.io/${{ github.repository }}/workbench-images:${{ inputs.target }}-${{ github.sha }}"
- uses: actions/upload-artifact@v4
if: ${{ fromJson(inputs.github).event_name == 'pull_request' && contains(inputs.target, 'codeserver') }}
with:
name: playwright-report
path: playwright-report/
retention-days: 30

- run: df -h
if: "${{ !cancelled() }}"

0 comments on commit a87acd7

Please sign in to comment.