Skip to content

e2e github actions #7011

e2e github actions

e2e github actions #7011

Workflow file for this run

name: End-to-end tests of web+runtime
on:
pull_request:
paths:
- ".github/workflows/web-test-e2e.yml"
- "admin/**"
- "cli/**"
- "runtime/**"
- "web-admin/**"
- "web-auth/**"
- "web-common/**"
- "web-local/**"
jobs:
build:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.matrix.outputs.matrix }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Filter modified codepaths
uses: dorny/paths-filter@v3
id: filter
with:
filters: |
admin:
- ".github/workflows/web-test-e2e.yml"
- "admin/**"
- "cli/**"
- "runtime/**"
- "web-admin/**"
auth:
- ".github/workflows/web-test-e2e.yml"
- "web-auth/**"
local:
- ".github/workflows/web-test-e2e.yml"
- "cli/**"
- "runtime/**"
- "web-local/**"
common:
- ".github/workflows/web-test-e2e.yml"
- "cli/**"
- "runtime/**"
- "web-common/**"
- name: Evaluate e2e tests matrix
id: matrix
run: |
echo "matrix=$(jq -n '[
"web-admin" | select(${{ steps.filter.outputs.admin }} == "true" or ${{ steps.filter.outputs.common }} == "true"),
"web-local" | select(${{ steps.filter.outputs.local }} == "true" or ${{ steps.filter.outputs.common }} == "true")
]' | jq -c)" >> "$GITHUB_OUTPUT"
e2e:
runs-on: ubuntu-latest
needs: build
strategy:
fail-fast: false
matrix:
name: ${{ fromJson(needs.build.outputs.matrix) }}
steps:
- name: Set up NodeJS
uses: actions/setup-node@v4
with:
node-version: 20
- name: Set up go for E2E
uses: actions/setup-go@v5
with:
go-version: 1.23
- name: Checkout code
uses: actions/checkout@v4
- name: go build cache
uses: actions/cache@v4
with:
path: |
~/go/pkg/mod
~/.cache/go-build
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: NPM Install
run: npm install
# https://typicode.github.io/husky/how-to.html#ci-server-and-docker
env:
HUSKY: 0
- name: Build and embed static UI
run: PLAYWRIGHT_TEST=true make cli
- name: Add CLI binary to PATH
run: echo "$GITHUB_WORKSPACE" >> $GITHUB_PATH
- name: Install browser for UI tests
run: npx playwright install
- name: Authenticate GCloud
uses: google-github-actions/auth@v2
if: matrix.name == 'web-admin'
with:
credentials_json: "${{ secrets.RILL_BINARY_SA }}"
- name: Set up GCloud SDK
if: matrix.name == 'web-admin'
uses: google-github-actions/setup-gcloud@v2
- name: Test ${{ matrix.name }}
run: |-
npm run build -w ${{ matrix.name }}
npm run test -w ${{ matrix.name }}
- uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report
path: ${{ matrix.name }}/playwright-report/
retention-days: 30