This repository has been archived by the owner on Jan 30, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The reason behind this is that the E2E tests take huge resource on Github and become more flaky when run together both with sync and async examples. Since we're using a weak Github runner.
- Loading branch information
1 parent
6ae719b
commit 8b9d9de
Showing
1 changed file
with
73 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,73 @@ | ||
name: sync_E2E | ||
on: | ||
# Enable manually triggering this workflow via the API or web UI | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
schedule: | ||
# At 06:00 AM UTC from Monday through Friday | ||
- cron: '0 6 * * 1-5' | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
jobs: | ||
test: | ||
strategy: | ||
matrix: | ||
go: [stable, tip] | ||
platform: [ubuntu-latest, windows-latest, macos-latest] | ||
runs-on: ${{ matrix.platform }} | ||
steps: | ||
- name: Checkout code | ||
if: matrix.go != 'tip' || matrix.platform != 'windows-latest' | ||
uses: actions/checkout@v4 | ||
- name: Install Go | ||
if: matrix.go != 'tip' || matrix.platform != 'windows-latest' | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: 1.x | ||
- name: Install Go tip | ||
if: matrix.go == 'tip' && matrix.platform != 'windows-latest' | ||
run: | | ||
go install golang.org/dl/gotip@latest | ||
gotip download | ||
echo "GOROOT=$HOME/sdk/gotip" >> "$GITHUB_ENV" | ||
echo "GOPATH=$HOME/go" >> "$GITHUB_ENV" | ||
echo "$HOME/go/bin" >> "$GITHUB_PATH" | ||
echo "$HOME/sdk/gotip/bin" >> "$GITHUB_PATH" | ||
- name: Install xk6 | ||
if: matrix.go != 'tip' || matrix.platform != 'windows-latest' | ||
run: go install go.k6.io/xk6/cmd/xk6@master | ||
- name: Build extension | ||
if: matrix.go != 'tip' || matrix.platform != 'windows-latest' | ||
run: | | ||
which go | ||
go version | ||
GOPRIVATE="go.k6.io/k6" xk6 build \ | ||
--output ./k6extension \ | ||
--with github.com/grafana/xk6-browser=. | ||
./k6extension version | ||
- name: Run E2E tests | ||
if: matrix.go != 'tip' || matrix.platform != 'windows-latest' | ||
run: | | ||
set -x | ||
if [ "$RUNNER_OS" == "Linux" ]; then | ||
export K6_BROWSER_EXECUTABLE_PATH=/usr/bin/google-chrome | ||
fi | ||
export K6_BROWSER_HEADLESS=true | ||
for f in sync-examples/*.js; do | ||
if [ "$f" == "sync-examples/sync_hosts.js" ] && [ "$RUNNER_OS" == "Windows" ]; then | ||
echo "skipping $f on Windows" | ||
continue | ||
fi | ||
./k6extension run -q "$f" | ||
done | ||
- name: Check screenshot | ||
if: matrix.go != 'tip' || matrix.platform != 'windows-latest' | ||
# TODO: Do something more sophisticated? | ||
run: test -s screenshot.png |