|
name: e2e tests |
|
|
|
on: |
|
workflow_dispatch: |
|
push: |
|
branches: |
|
- master |
|
pull_request: |
|
|
|
permissions: |
|
contents: read |
|
packages: read |
|
|
|
concurrency: |
|
group: e2e-tests-${{ github.head_ref || github.run_id }} |
|
cancel-in-progress: true |
|
|
|
jobs: |
|
e2e-tests: |
|
name: e2e tests (ruby ${{ matrix.ruby.flavor }}, ${{ matrix.adapter }}) |
|
runs-on: ubuntu-latest |
|
timeout-minutes: 8 |
|
|
|
strategy: |
|
fail-fast: false |
|
matrix: |
|
ruby: |
|
- version: "3.4.9" |
|
flavor: "3.4" |
|
- version: "4.0.3" |
|
flavor: "4.0" |
|
adapter: |
|
- async |
|
- inline |
|
- sidekiq |
|
- resque |
|
- delayed_job |
|
- solid_queue |
|
|
|
steps: |
|
- name: Checkout code |
|
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 |
|
|
|
- name: Read devcontainer version |
|
id: devcontainer-version |
|
run: echo "version=$(cat .devcontainer/VERSION)" >> $GITHUB_OUTPUT |
|
|
|
- name: Set up `.env` file |
|
run: | |
|
cd .devcontainer |
|
cp .env.example .env |
|
echo "RUBY_VERSION=${{ matrix.ruby.version }}" >> .env |
|
echo "DOCKER_IMAGE=ghcr.io/getsentry/sentry-ruby-devcontainer-${{ matrix.ruby.flavor }}" >> .env |
|
echo "DOCKER_TAG=${{ steps.devcontainer-version.outputs.version }}" >> .env |
|
echo "SENTRY_E2E_ACTIVE_JOB_ADAPTER=${{ matrix.adapter }}" >> .env |
|
|
|
- name: Log in to GHCR |
|
uses: docker/login-action@650006c6eb7dba73a995cc03b0b2d7f5ca915bee # v4.2.0 |
|
with: |
|
registry: ghcr.io |
|
username: ${{ github.actor }} |
|
password: ${{ secrets.GITHUB_TOKEN }} |
|
|
|
- name: Pull test container image |
|
run: docker pull ghcr.io/getsentry/sentry-ruby-devcontainer-${{ matrix.ruby.flavor }}:${{ steps.devcontainer-version.outputs.version }} |
|
|
|
- name: Restore node_modules cache |
|
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 |
|
with: |
|
path: spec/apps/svelte-mini/node_modules |
|
key: ${{ runner.os }}-${{ runner.arch }}-node-modules-${{ hashFiles('spec/apps/svelte-mini/package-lock.json') }} |
|
restore-keys: | |
|
${{ runner.os }}-${{ runner.arch }}-node-modules- |
|
|
|
- name: Set up test container |
|
run: | |
|
docker compose \ |
|
--file .devcontainer/docker-compose.yml \ |
|
--env-file .devcontainer/.env \ |
|
--profile e2e \ |
|
run --rm sentry-test \ |
|
.devcontainer/setup --only .,spec/apps/rails-mini |
|
|
|
- name: Start test services |
|
run: | |
|
docker compose \ |
|
--file .devcontainer/docker-compose.yml \ |
|
--env-file .devcontainer/.env \ |
|
--profile e2e \ |
|
up -d --no-build sentry-test |
|
|
|
- name: "Wait for rails-mini app to be ready" |
|
uses: nev7n/wait_for_response@8bfc0523300e46e24e1b42d6783680aa921ee6cc # v1.2.0 |
|
with: |
|
url: 'http://localhost:4000/health' |
|
responseCode: 200 |
|
timeout: 90000 |
|
interval: 500 |
|
|
|
- name: "Wait for svelte-mini app to be ready" |
|
uses: nev7n/wait_for_response@8bfc0523300e46e24e1b42d6783680aa921ee6cc # v1.2.0 |
|
with: |
|
url: 'http://localhost:4001/health' |
|
responseCode: 200 |
|
timeout: 90000 |
|
interval: 500 |
|
|
|
- name: Run e2e tests via sentry-test |
|
run: | |
|
docker compose \ |
|
--file .devcontainer/docker-compose.yml \ |
|
--env-file .devcontainer/.env \ |
|
--profile e2e \ |
|
exec sentry-test \ |
|
bundle exec rake |
|
|
|
- name: Stop e2e services |
|
if: always() |
|
run: docker compose --file .devcontainer/docker-compose.yml --profile e2e down |
|
|
|
- name: Upload test artifacts |
|
if: failure() |
|
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 |
|
with: |
|
name: e2e-test-logs-ruby-${{ matrix.ruby.version }}-${{ matrix.adapter }} |
|
path: | |
|
log/sentry_debug_events.log |
|
retention-days: 7 |