Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

e2e github actions #6303

Open
wants to merge 31 commits into
base: cloud-e2e-setup-services
Choose a base branch
from
Open
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
782f595
e2e github actions
himadrisingh Dec 18, 2024
f7c6cc5
Update web-test-e2e.yml
himadrisingh Dec 18, 2024
de0b285
Update web-test-e2e.yml
himadrisingh Dec 18, 2024
2874c98
Update web-test-e2e.yml
himadrisingh Dec 18, 2024
0949768
Update web-test-e2e.yml
himadrisingh Dec 18, 2024
22c87ec
Update web-test-e2e.yml
himadrisingh Dec 19, 2024
e965629
Update web-test-e2e.yml
himadrisingh Dec 19, 2024
044e0fb
Update web-test-e2e.yml
himadrisingh Dec 19, 2024
ef693d6
Update web-test-e2e.yml
himadrisingh Dec 19, 2024
fe9f1d5
Update web-test-e2e.yml
himadrisingh Dec 19, 2024
934cfe7
Update web-test-e2e.yml
himadrisingh Dec 19, 2024
d9f07a8
Update web-test-e2e.yml
himadrisingh Dec 19, 2024
44bf655
Update web-test-e2e.yml
himadrisingh Dec 19, 2024
e7d6ac7
Update web-test-e2e.yml
himadrisingh Dec 19, 2024
0076985
Update web-test-e2e.yml
himadrisingh Dec 19, 2024
024b55a
Update web-test-e2e.yml
himadrisingh Dec 19, 2024
456ed4b
Update web-test-e2e.yml
himadrisingh Dec 19, 2024
89c93aa
Update web-test-e2e.yml
himadrisingh Dec 19, 2024
7217dbd
Update web-test-e2e.yml
himadrisingh Dec 19, 2024
d80b84e
Update web-test-e2e.yml
himadrisingh Dec 19, 2024
cfab268
Update web-test-e2e.yml
himadrisingh Dec 19, 2024
014797f
Update web-test-e2e.yml
himadrisingh Dec 19, 2024
69ac430
Update web-test-e2e.yml
himadrisingh Dec 19, 2024
8728a69
Update web-test-e2e.yml
himadrisingh Dec 19, 2024
f024e55
Update web-test-e2e.yml
himadrisingh Dec 19, 2024
0c15930
Update web-test-e2e.yml
himadrisingh Dec 19, 2024
ebfaacf
Update web-test-e2e.yml
himadrisingh Dec 19, 2024
0eec4dd
de bug
himadrisingh Dec 19, 2024
5df64e0
Update web-test-e2e.yml
himadrisingh Dec 20, 2024
f63fb07
Update .github/workflows/web-test-e2e.yml
himadrisingh Dec 27, 2024
5cc631d
Revert "Update .github/workflows/web-test-e2e.yml"
himadrisingh Dec 27, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 47 additions & 15 deletions .github/workflows/web-test-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: End-to-end tests of web+runtime
on:
pull_request:
paths:
- ".github/workflows/web-test.yml"
- ".github/workflows/web-test-e2e.yml"
- "admin/**"
- "cli/**"
- "runtime/**"
Expand All @@ -13,6 +13,9 @@ on:
jobs:
build:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.matrix.outputs.matrix }}

steps:
- name: Checkout code
uses: actions/checkout@v4
Expand All @@ -23,25 +26,45 @@ jobs:
with:
filters: |
admin:
- ".github/workflows/web-test.yml"
- ".github/workflows/web-test-e2e.yml"
- "admin/**"
- "cli/**"
- "runtime/**"
- "web-admin/**"
auth:
- ".github/workflows/web-test.yml"
- ".github/workflows/web-test-e2e.yml"
- "web-auth/**"
local:
- ".github/workflows/web-test.yml"
- ".github/workflows/web-test-e2e.yml"
- "cli/**"
- "runtime/**"
- "web-local/**"
common:
- ".github/workflows/web-test.yml"
- ".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(env.FILTER_ADMIN == "true" or env.FILTER_COMMON == "true"),
"web-local" | select(env.FILTER_LOCAL == "true" or env.FILTER_COMMON == "true")
]' | jq -c)" >> "$GITHUB_OUTPUT"
env:
FILTER_ADMIN: ${{ steps.filter.outputs.admin }}
FILTER_COMMON: ${{ steps.filter.outputs.common }}
FILTER_LOCAL: ${{ steps.filter.outputs.local }}
Comment on lines +50 to +58
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It feels like these environment variables are adding an extra layer of indirection. Could we use filter.outputs directly in the jq command like: select(${{ steps.filter.outputs.admin }} == "true" or ${{ steps.filter.outputs.common }} == "true")?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Further, can we treat the filter output like a typical boolean, not a string, like:
select(${{ steps.filter.outputs.admin }} or ${{ steps.filter.outputs.common }})
or even without the select function:
if ${{ steps.filter.outputs.admin }} or ${{ steps.filter.outputs.common }} then "web-admin" else empty end

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, it doesn't have access to steps.filter.outputs.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure? This example seems to show it's possible.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i tried f63fb07 but it didnt work out. probably its jq or single quote.

himadrisingh marked this conversation as resolved.
Show resolved Hide resolved

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:
Expand All @@ -51,6 +74,10 @@ jobs:
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:
Expand All @@ -76,19 +103,24 @@ jobs:
- name: Install browser for UI tests
run: npx playwright install

- name: Test `web-local`
if: ${{ steps.filter.outputs.local == 'true' || steps.filter.outputs.common == 'true' }}
run: npm run test -w web-local
- 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: web-local/playwright-report/
path: ${{ matrix.name }}/playwright-report/
retention-days: 30

- name: Build and test `web-admin`
if: ${{ steps.filter.outputs.admin == 'true' || steps.filter.outputs.common == 'true' }}
run: |-
npm run build -w web-admin
npm run test -w web-admin
Loading