|
| 1 | +name: e2e tests |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + push: |
| 6 | + branches: |
| 7 | + - master |
| 8 | + pull_request: |
| 9 | + |
| 10 | +permissions: |
| 11 | + contents: read |
| 12 | + |
| 13 | +concurrency: |
| 14 | + group: e2e-tests-${{ github.head_ref || github.run_id }} |
| 15 | + cancel-in-progress: true |
| 16 | + |
| 17 | +jobs: |
| 18 | + e2e-tests: |
| 19 | + name: e2e tests |
| 20 | + runs-on: ubuntu-latest |
| 21 | + timeout-minutes: 5 |
| 22 | + |
| 23 | + strategy: |
| 24 | + fail-fast: false |
| 25 | + matrix: |
| 26 | + ruby_version: ["3.4.5"] |
| 27 | + |
| 28 | + env: |
| 29 | + DOCKER_IMAGE: "ghcr.io/getsentry/sentry-ruby-devcontainer-3.4" |
| 30 | + DOCKER_TAG: "9c29d73a943de506a5990f7407c93663c80b44fd" |
| 31 | + |
| 32 | + steps: |
| 33 | + - name: Checkout code |
| 34 | + uses: actions/checkout@v4 |
| 35 | + |
| 36 | + - name: Set up `.env` file |
| 37 | + run: | |
| 38 | + cd .devcontainer |
| 39 | + cp .env.example .env |
| 40 | +
|
| 41 | + - name: Restore rubygems cache |
| 42 | + uses: actions/cache@v3 |
| 43 | + with: |
| 44 | + path: vendor/gems |
| 45 | + key: ${{ runner.os }}-${{ matrix.ruby_version }}-gems-${{ hashFiles('Gemfile.lock', '*/Gemfile.lock', 'spec/apps/**/Gemfile.lock') }} |
| 46 | + restore-keys: | |
| 47 | + ${{ runner.os }}-${{ matrix.ruby_version }}-gems- |
| 48 | +
|
| 49 | + - name: Restore node_modules cache |
| 50 | + uses: actions/cache@v3 |
| 51 | + with: |
| 52 | + path: spec/apps/svelte-mini/node_modules |
| 53 | + key: ${{ runner.os }}-node-modules-${{ hashFiles('spec/apps/svelte-mini/package-lock.json') }} |
| 54 | + restore-keys: | |
| 55 | + ${{ runner.os }}-node-modules- |
| 56 | +
|
| 57 | + - name: Set up test services |
| 58 | + run: | |
| 59 | + docker compose \ |
| 60 | + --file .devcontainer/docker-compose.yml \ |
| 61 | + --env-file .devcontainer/.env \ |
| 62 | + run --rm sentry-test-services \ |
| 63 | + echo "Done" |
| 64 | +
|
| 65 | + - name: Start test services |
| 66 | + run: | |
| 67 | + docker compose \ |
| 68 | + --file .devcontainer/docker-compose.yml \ |
| 69 | + --env-file .devcontainer/.env \ |
| 70 | + up -d sentry-test-services |
| 71 | +
|
| 72 | + - name: "Wait for rails-mini app to be ready" |
| 73 | + uses: nev7n/wait_for_response@v1 |
| 74 | + with: |
| 75 | + url: 'http://localhost:4000/health' |
| 76 | + responseCode: 200 |
| 77 | + timeout: 90000 |
| 78 | + interval: 500 |
| 79 | + |
| 80 | + - name: "Wait for svelte-mini app to be ready" |
| 81 | + uses: nev7n/wait_for_response@v1 |
| 82 | + with: |
| 83 | + url: 'http://localhost:4001/health' |
| 84 | + responseCode: 200 |
| 85 | + timeout: 90000 |
| 86 | + interval: 500 |
| 87 | + |
| 88 | + - name: Set up sentry-test container |
| 89 | + run: | |
| 90 | + docker compose \ |
| 91 | + --file .devcontainer/docker-compose.yml \ |
| 92 | + --env-file .devcontainer/.env \ |
| 93 | + run --rm sentry-test \ |
| 94 | + echo "Done" |
| 95 | +
|
| 96 | + - name: Run e2e tests via sentry-test |
| 97 | + run: | |
| 98 | + docker compose \ |
| 99 | + --file .devcontainer/docker-compose.yml \ |
| 100 | + --env-file .devcontainer/.env \ |
| 101 | + run --rm sentry-test \ |
| 102 | + bundle exec rake |
| 103 | +
|
| 104 | + - name: Stop e2e services |
| 105 | + if: always() |
| 106 | + run: docker compose --file .devcontainer/docker-compose.yml down |
| 107 | + |
| 108 | + - name: Upload test artifacts |
| 109 | + if: failure() |
| 110 | + uses: actions/upload-artifact@v4 |
| 111 | + with: |
| 112 | + name: e2e-test-logs-ruby-${{ matrix.ruby_version }} |
| 113 | + path: | |
| 114 | + log/sentry_debug_events.log |
| 115 | + retention-days: 7 |
0 commit comments