This repository has been archived by the owner on Jul 24, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
134 lines (123 loc) · 4.6 KB
/
e2e.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
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
jobs:
e2e_satellite_tests:
name: E2E Satellite tests
runs-on: ubuntu-latest
strategy:
matrix:
dialect: [SQLite, Postgres]
defaults:
run:
working-directory: e2e
env:
# BUILDKITE_ANALYTICS_TOKEN: ${{ secrets.BUILDKITE_TEST_ANALYTICS_E2E }}
ELECTRIC_REPO: e2e/electric_repo
DIALECT: ${{ matrix.dialect }}
steps:
- uses: actions/checkout@v3
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: 900000 # 15 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