This repository has been archived by the owner on Jul 24, 2024. It is now read-only.
Upstream changes #435
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: E2E | |
on: | |
push: | |
branches: | |
- master | |
- develop | |
- feat/* | |
pull_request: | |
paths-ignore: | |
# Root files | |
- '*' | |
# CI files not related to GH actions | |
- '.buildkite/**' | |
- '**/README.md' | |
- 'docs/**' | |
env: | |
OTP_VERSION: "27.0" | |
ELIXIR_VERSION: "1.17.0-otp-27" | |
# Only run one E2E workflow at the same time | |
# Cancel-pending: false does not exist, so when pushing different branches at the same time | |
# they get cancelled | |
# Alternatively use the Github Action: ahmadnassri/action-workflow-queue | |
# concurrency: | |
# group: e2e-${{ github.workflow }} | |
# cancel-in-progress: false | |
concurrency: | |
group: e2e-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
e2e_satellite_tests: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
dialect: [SQLite, Postgres] | |
dal: [true, false] | |
name: E2E Satellite tests (Dialect ${{ matrix.dialect }} - uses DAL? ${{ matrix.dal }}) | |
defaults: | |
run: | |
working-directory: e2e | |
env: | |
# BUILDKITE_ANALYTICS_TOKEN: ${{ secrets.BUILDKITE_TEST_ANALYTICS_E2E }} | |
ELECTRIC_REPO: e2e/electric_repo | |
DIALECT: ${{ matrix.dialect }} | |
DAL: ${{ matrix.dal }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.event.pull_request.head.sha }} | |
fetch-depth: 0 | |
# Make sure that only one E2E workflow is running at the same time | |
# Ports used in the tests are fixed and cannot be reused | |
# - uses: ahmadnassri/action-workflow-queue@v1 | |
# with: | |
# # milliseconds | |
# timeout: 1500000 # 25 minutes | |
- name: Inject slug/short variables | |
uses: rlespinasse/github-slug-action@v4 | |
- name: Inject variables for `docker buildx` github actions caching | |
uses: crazy-max/ghaction-github-runtime@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Log in to the Container registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- uses: erlef/setup-beam@v1 | |
with: | |
otp-version: ${{ env.OTP_VERSION }} | |
elixir-version: ${{ env.ELIXIR_VERSION }} | |
- run: make clone_electric | |
name: Clone electric at based commit | |
working-directory: e2e | |
- run: | | |
echo "ELECTRIC_VERSION=$(make --silent print_version_from_git)" >> $GITHUB_ENV | |
working-directory: ${{env.ELECTRIC_REPO}}/components/electric | |
- run: make docker-build-ci | |
env: | |
ELECTRIC_IMAGE_NAME: electric-sql-ci/electric | |
working-directory: ${{env.ELECTRIC_REPO}}/components/electric | |
- run: make docker-build-ws-client | |
env: | |
ELECTRIC_CLIENT_IMAGE_NAME: electric-sql-ci/electric-ws-client | |
working-directory: ${{env.ELECTRIC_REPO}}/components/electric | |
- name: Cache built lux | |
uses: actions/cache@v3 | |
with: | |
path: | | |
e2e/lux/bin | |
e2e/lux/ebin | |
e2e/lux/priv | |
key: ${{ runner.os }}-luxbuilt-${{ env.OTP_VERSION }}-${{ env.ELIXIR_VERSION }} | |
- run: make lux | |
- run: make deps pull | |
# - run: make test-satellite-only | |
# Avoid e2e flakiness by running only the Dart client e2e tests | |
# We assume that the electric service e2e tests work on upstream | |
# Tests are flaky on GHA, so we have a custom wrapper script that retries them | |
- run: ./run_client_e2e_with_retries.sh | |
id: tests | |
env: | |
ELECTRIC_IMAGE_NAME: electric-sql-ci/electric | |
ELECTRIC_CLIENT_IMAGE_NAME: electric-sql-ci/electric-ws-client | |
ELECTRIC_IMAGE_TAG: ${{ env.ELECTRIC_VERSION }} | |
- name: Upload lux logs | |
uses: actions/upload-artifact@v3 | |
if: ${{ failure() && steps.tests.outcome == 'failure' }} | |
with: | |
name: lux_logs | |
path: e2e/**/lux_logs/run_* | |
# - name: Upload test results to Buildkite analytics | |
# if: ${{ !cancelled() && steps.tests.outcome != 'skipped' && env.BUILDKITE_ANALYTICS_TOKEN != '' }} | |
# working-directory: e2e/lux_logs/latest_run | |
# run: | | |
# curl \ | |
# -X POST \ | |
# --fail-with-body \ | |
# -H "Authorization: Token token=\"$BUILDKITE_ANALYTICS_TOKEN\"" \ | |
# -F "data=@lux_junit.xml" \ | |
# -F "format=junit" \ | |
# -F "run_env[CI]=github_actions" \ | |
# -F "run_env[key]=$GITHUB_ACTION-$GITHUB_RUN_NUMBER-$GITHUB_RUN_ATTEMPT" \ | |
# -F "run_env[number]=$GITHUB_RUN_NUMBER" \ | |
# -F "run_env[branch]=$GITHUB_REF" \ | |
# -F "run_env[commit_sha]=$GITHUB_SHA" \ | |
# -F "run_env[url]=https://github.com/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" \ | |
# https://analytics-api.buildkite.com/v1/uploads |