feat: add flexible section #13284
Workflow file for this run
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
name: CI | |
on: [ push, pull_request ] | |
jobs: | |
prepare: | |
# Prevent workflow being run twice, https://github.com/orgs/community/discussions/57827#discussioncomment-6579237 | |
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- id: getMatrix | |
run: | | |
matrix=`node ./.github/workflows/ci/getTestJobs.mjs --ci` | |
echo "matrix=$matrix" >> $GITHUB_OUTPUT | |
- run: echo ${{ steps.getMatrix.outputs.matrix }} | |
outputs: | |
matrix: ${{ steps.getMatrix.outputs.matrix }} | |
test: | |
needs: prepare | |
strategy: | |
matrix: ${{fromJson(needs.prepare.outputs.matrix)}} | |
fail-fast: false | |
env: | |
TEST_FILES: ${{ matrix.TEST_FILES }} | |
TEST_INSPECT: ${{ matrix.TEST_INSPECT }} | |
runs-on: ${{ matrix.os }} | |
name: '${{ matrix.jobName }}' | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: pnpm/action-setup@v4 | |
- name: Set node version to ${{ matrix.node_version }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node_version }} | |
# TODO/eventually: try using the cache again | |
# The cache breaks playwright https://github.com/vikejs/vike-vue/pull/119 | |
# cache: "pnpm" | |
- run: pnpm install | |
- run: pnpm exec playwright install chromium | |
- run: pnpm run build | |
- name: Run tests | |
run: ${{ matrix.jobCmd }} | |
env: | |
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
- name: Upload screenshots | |
if: ${{ failure() }} | |
uses: actions/upload-artifact@v3 | |
with: | |
name: 'screenshots' | |
path: | | |
**/test-screenshot-expect.png | |
**/test-screenshot-actual.png | |
**/test-screenshot-differ.png |