refa(devcontainer): rework to use mise for fast switching #1015
Workflow file for this run
This file contains hidden or 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 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 | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 5 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - ruby_version: "3.4.9" | |
| flavor: "3.4" | |
| - ruby_version: "4.0.3" | |
| flavor: "4.0" | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 | |
| - 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.flavor }}" >> .env | |
| echo "DOCKER_TAG=${{ steps.devcontainer-version.outputs.version }}" >> .env | |
| - name: Log in to GHCR | |
| uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3 | |
| 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.flavor }}:${{ steps.devcontainer-version.outputs.version }} | |
| - name: Restore node_modules cache | |
| uses: actions/cache@6f8efc29b200d32929f49075959781ed54ec270c # v3 | |
| 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@81b0b0eded16435202e126beb3e704fc00430f5b # v1 | |
| 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@81b0b0eded16435202e126beb3e704fc00430f5b # v1 | |
| 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@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 | |
| with: | |
| name: e2e-test-logs-ruby-${{ matrix.ruby_version }} | |
| path: | | |
| log/sentry_debug_events.log | |
| retention-days: 7 |