Skip to content

Commit 305e43d

Browse files
committed
ci: Use bin/test and mise in test workflows
* add `--entry` option to `bin/test` to enable direct json passthrough from matrix in CI * replace individual gem workflows with single reusable `gem_test` workflow
1 parent 929016c commit 305e43d

20 files changed

Lines changed: 156 additions & 574 deletions

File tree

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Set up mise Ruby toolchain
2+
description: >-
3+
Install all the CI matrix Rubies via mise with the per-version bundler pins from
4+
.mise.ci.toml (MISE_ENV=ci) — the same toolchain bin/test and bin/relock use.
5+
Config + cache key are shared across every caller (the *_test workflows and
6+
update_lockfiles), so they all restore the one weekly-populated cache.
7+
8+
runs:
9+
using: composite
10+
steps:
11+
- uses: jdx/mise-action@e6a8b3978addb5a52f2b4cd9d91eafa7f0ab959d # v4.2.0
12+
env:
13+
MISE_ENV: ci
14+
MISE_JOBS: "2"
15+
with:
16+
install: true
17+
cache: true

.github/workflows/gem_test.yml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: Gem Test
2+
3+
# Reusable, gem-agnostic test workflow. tests.yml invokes it once per gem via a
4+
# central matrix, passing the gem dir plus whatever optional service/packages
5+
# that gem needs. The per-cell matrix still comes from each gem's
6+
# test-matrix.json (the single source of truth), expanded here and run via
7+
# bin/test — so adding/removing a cell never touches this file.
8+
9+
on:
10+
workflow_call:
11+
inputs:
12+
gem:
13+
description: Gem directory to test (e.g. sentry-ruby).
14+
required: true
15+
type: string
16+
apt:
17+
description: Space-separated apt packages to install before testing.
18+
type: string
19+
default: ""
20+
21+
jobs:
22+
matrix:
23+
runs-on: ubuntu-latest
24+
outputs:
25+
include: ${{ steps.set.outputs.include }}
26+
steps:
27+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
28+
- id: set
29+
run: echo "include=$(jq -c . ${{ inputs.gem }}/test-matrix.json)" >> "$GITHUB_OUTPUT"
30+
31+
test:
32+
needs: matrix
33+
defaults:
34+
run:
35+
working-directory: ${{ inputs.gem }}
36+
name: ${{ toJson(matrix) }}
37+
runs-on: ubuntu-latest
38+
timeout-minutes: 10
39+
services:
40+
redis:
41+
image: ghcr.io/getsentry/image-mirror-library-redis:7.0.8-bullseye
42+
ports:
43+
- 6379:6379
44+
options: >-
45+
--health-cmd "redis-cli ping"
46+
--health-interval 10s
47+
--health-timeout 5s
48+
--health-retries 5
49+
strategy:
50+
fail-fast: false
51+
matrix:
52+
include: ${{ fromJson(needs.matrix.outputs.include) }}
53+
steps:
54+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
55+
56+
- name: Install apt packages
57+
if: inputs.apt != ''
58+
run: |
59+
sudo apt-get update
60+
sudo apt-get install --no-install-recommends ${{ inputs.apt }}
61+
62+
- name: Set up Ruby
63+
uses: ./.github/actions/setup-mise
64+
65+
- name: Run specs
66+
env:
67+
MATRIX_ENTRY: ${{ toJson(matrix) }}
68+
run: ruby ../bin/test --entry "$MATRIX_ENTRY" --rake
69+
70+
- name: Upload Coverage
71+
uses: codecov/codecov-action@1af58845a975a7985b0beb0cbe6fbbb71a41dbad # v5
72+
with:
73+
token: ${{ secrets.CODECOV_TOKEN }}

.github/workflows/sentry_delayed_job_test.yml

Lines changed: 0 additions & 73 deletions
This file was deleted.

.github/workflows/sentry_opentelemetry_test.yml

Lines changed: 0 additions & 68 deletions
This file was deleted.

.github/workflows/sentry_rails_test.yml

Lines changed: 0 additions & 69 deletions
This file was deleted.

.github/workflows/sentry_resque_test.yml

Lines changed: 0 additions & 82 deletions
This file was deleted.

0 commit comments

Comments
 (0)