Skip to content

Commit 2a28c01

Browse files
authored
Better CI setup (#2563)
* Run all tests in a single workflow with CodeCov * Add codecov token
1 parent ffd993a commit 2a28c01

File tree

9 files changed

+147
-71
lines changed

9 files changed

+147
-71
lines changed

.github/workflows/codecov.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,8 @@ on:
2121
jobs:
2222
codecov:
2323
runs-on: ubuntu-latest
24-
if: ${{ github.event.workflow_run.conclusion == 'success' }}
24+
# if: ${{ github.event.workflow_run.conclusion == 'success' }}
2525
steps:
2626
- name: Codecov
27-
uses: codecov/[email protected]
28-
29-
- name: Trigger Codecov
30-
run: codecovcli send-notifications
27+
uses: codecov/codecov-action@13ce06bfc6bbe3ecf90edbbf1bc32fe5978ca1d3
28+
run_command: send-notifications

.github/workflows/sentry_delayed_job_test.yml

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,22 @@ name: sentry-delayed_job Test
22

33
on:
44
workflow_dispatch:
5-
push:
6-
branches:
7-
- master
8-
- \d+-\d+
9-
pull_request:
5+
workflow_call:
6+
outputs:
7+
matrix-result:
8+
description: "Matrix job result"
9+
value: ${{ jobs.test.outputs.matrix-result }}
10+
inputs:
11+
versions:
12+
required: true
13+
type: string
1014
# Cancel in progress workflows on pull_requests.
1115
# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value
1216
concurrency:
13-
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
17+
group: sentry-delayed-job-test-${{ github.head_ref || github.run_id }}
1418
cancel-in-progress: true
1519
jobs:
16-
ruby-versions:
17-
uses: ruby/actions/.github/workflows/ruby_versions.yml@master
18-
with:
19-
engine: cruby-jruby
20-
min_version: 2.4
2120
test:
22-
needs: ruby-versions
2321
defaults:
2422
run:
2523
working-directory: sentry-delayed_job
@@ -32,7 +30,7 @@ jobs:
3230
strategy:
3331
fail-fast: false
3432
matrix:
35-
ruby_version: ${{ fromJson(needs.ruby-versions.outputs.versions) }}
33+
ruby_version: ${{ fromJson(inputs.versions) }}
3634
include:
3735
- ruby_version: "3.2"
3836
options:

.github/workflows/sentry_opentelemetry_test.yml

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,22 @@ name: sentry-opentelemetry Test
22

33
on:
44
workflow_dispatch:
5-
push:
6-
branches:
7-
- master
8-
- \d+-\d+
9-
pull_request:
5+
workflow_call:
6+
outputs:
7+
matrix-result:
8+
description: "Matrix job result"
9+
value: ${{ jobs.test.outputs.matrix-result }}
10+
inputs:
11+
versions:
12+
required: true
13+
type: string
1014
# Cancel in progress workflows on pull_requests.
1115
# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value
1216
concurrency:
13-
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
17+
group: sentry-opentelemetry-test-${{ github.head_ref || github.run_id }}
1418
cancel-in-progress: true
1519
jobs:
16-
ruby-versions:
17-
uses: ruby/actions/.github/workflows/ruby_versions.yml@master
18-
with:
19-
engine: cruby-jruby
20-
min_version: 2.6
2120
test:
22-
needs: ruby-versions
2321
defaults:
2422
run:
2523
working-directory: sentry-opentelemetry
@@ -33,7 +31,7 @@ jobs:
3331
strategy:
3432
fail-fast: false
3533
matrix:
36-
ruby_version: ${{ fromJson(needs.ruby-versions.outputs.versions) }}
34+
ruby_version: ${{ fromJson(inputs.versions) }}
3735
# opentelemetry_version: [1.2.0]
3836
include:
3937
- ruby_version: 3.2

.github/workflows/sentry_rails_test.yml

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@ name: sentry-rails Test
22

33
on:
44
workflow_dispatch:
5-
push:
6-
branches:
7-
- master
8-
- \d+-\d+
9-
pull_request:
5+
workflow_call:
6+
inputs:
7+
versions:
8+
required: true
9+
type: string
1010
# Cancel in progress workflows on pull_requests.
1111
# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value
1212
concurrency:
13-
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
13+
group: sentry-rails-test-${{ github.head_ref || github.run_id }}
1414
cancel-in-progress: true
1515
jobs:
1616
test:
@@ -27,8 +27,8 @@ jobs:
2727
strategy:
2828
fail-fast: false
2929
matrix:
30+
ruby_version: ${{ fromJson(inputs.versions) }}
3031
rails_version: [6.1.0, 7.0.0, 7.1.0]
31-
ruby_version: [2.7, "3.0", "3.1", "3.2", "3.3"]
3232
include:
3333
- ruby_version: "2.4"
3434
rails_version: 5.0.0
@@ -88,6 +88,14 @@ jobs:
8888
rubyopt: "--enable-frozen-string-literal --debug=frozen-string-literal"
8989
- ruby_version: "3.2"
9090
rails_version: 7.1.0
91+
exclude:
92+
- ruby_version: head
93+
- ruby_version: jruby-head
94+
- ruby_version: "3.4"
95+
rails_version: "6.1.0"
96+
- ruby_version: "3.4"
97+
rails_version: "7.0.0"
98+
9199
steps:
92100
- uses: actions/checkout@v4
93101
- name: Install sqlite and ImageMagick

.github/workflows/sentry_raven_test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ on:
1212
# Cancel in progress workflows on pull_requests.
1313
# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value
1414
concurrency:
15-
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
15+
group: sentry-raven-test-${{ github.head_ref || github.run_id }}
1616
cancel-in-progress: true
1717
jobs:
1818
test:

.github/workflows/sentry_resque_test.yml

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,22 @@ name: sentry-resque Test
22

33
on:
44
workflow_dispatch:
5-
push:
6-
branches:
7-
- master
8-
- \d+-\d+
9-
pull_request:
5+
workflow_call:
6+
outputs:
7+
matrix-result:
8+
description: "Matrix job result"
9+
value: ${{ jobs.test.outputs.matrix-result }}
10+
inputs:
11+
versions:
12+
required: true
13+
type: string
1014
# Cancel in progress workflows on pull_requests.
1115
# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value
1216
concurrency:
13-
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
17+
group: sentry-resque-test-${{ github.head_ref || github.run_id }}
1418
cancel-in-progress: true
1519
jobs:
16-
ruby-versions:
17-
uses: ruby/actions/.github/workflows/ruby_versions.yml@master
18-
with:
19-
engine: cruby-jruby
20-
min_version: 2.4
2120
test:
22-
needs: ruby-versions
2321
defaults:
2422
run:
2523
working-directory: sentry-resque
@@ -32,7 +30,7 @@ jobs:
3230
strategy:
3331
fail-fast: false
3432
matrix:
35-
ruby_version: ${{ fromJson(needs.ruby-versions.outputs.versions) }}
33+
ruby_version: ${{ fromJson(inputs.versions) }}
3634
include:
3735
- ruby_version: "3.2"
3836
options:

.github/workflows/sentry_ruby_test.yml

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,18 @@ name: sentry-ruby Test
22

33
on:
44
workflow_dispatch:
5-
push:
6-
branches:
7-
- master
8-
- \d+-\d+
9-
pull_request:
5+
workflow_call:
6+
inputs:
7+
versions:
8+
required: true
9+
type: string
1010
# Cancel in progress workflows on pull_requests.
1111
# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value
1212
concurrency:
13-
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
13+
group: sentry-ruby-test-${{ github.head_ref || github.run_id }}
1414
cancel-in-progress: true
1515
jobs:
16-
ruby-versions:
17-
uses: ruby/actions/.github/workflows/ruby_versions.yml@master
18-
with:
19-
engine: cruby-jruby
20-
min_version: 2.4
2116
test:
22-
needs: ruby-versions
2317
defaults:
2418
run:
2519
working-directory: sentry-ruby
@@ -35,7 +29,7 @@ jobs:
3529
strategy:
3630
fail-fast: false
3731
matrix:
38-
ruby_version: ${{ fromJson(needs.ruby-versions.outputs.versions) }}
32+
ruby_version: ${{ fromJson(inputs.versions) }}
3933
rack_version: [2.0, 3.0, 3.1]
4034
redis_rb_version: [4.0]
4135
include:

.github/workflows/sentry_sidekiq_test.yml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,15 @@ name: sentry-sidekiq Test
22

33
on:
44
workflow_dispatch:
5-
push:
6-
branches:
7-
- master
8-
- \d+-\d+
9-
pull_request:
5+
workflow_call:
6+
outputs:
7+
matrix-result:
8+
description: "Matrix job result"
9+
value: ${{ jobs.test.outputs.matrix-result }}
10+
inputs:
11+
versions:
12+
required: true
13+
type: string
1014
# Cancel in progress workflows on pull_requests.
1115
# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value
1216
concurrency:
@@ -27,8 +31,8 @@ jobs:
2731
strategy:
2832
fail-fast: false
2933
matrix:
34+
ruby_version: ${{ fromJson(inputs.versions) }}
3035
sidekiq_version: ["5.0", "6.5", "7.0"]
31-
ruby_version: ["2.7", "3.0", "3.1", "3.2", "3.3", "3.4", jruby]
3236
include:
3337
- ruby_version: 2.4
3438
sidekiq_version: 5.0
@@ -56,6 +60,9 @@ jobs:
5660
sidekiq_version: 8.0.0.beta1
5761
- ruby_version: "3.4"
5862
sidekiq_version: 8.0.0.beta1
63+
exclude:
64+
- ruby_version: head
65+
- ruby_version: jruby-head
5966
steps:
6067
- uses: actions/checkout@v4
6168

.github/workflows/tests.yml

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
name: Tests & CodeCov
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- master
8+
- \d+-\d+
9+
pull_request:
10+
11+
concurrency:
12+
group: tests-${{ github.head_ref || github.run_id }}
13+
cancel-in-progress: true
14+
15+
jobs:
16+
ruby-versions:
17+
uses: ruby/actions/.github/workflows/ruby_versions.yml@6d15c16f6259d657961bcdccf2598d3d53e90635
18+
with:
19+
engine: cruby-jruby
20+
min_version: 2.7
21+
22+
delayed_job-tests:
23+
needs: ruby-versions
24+
uses: ./.github/workflows/sentry_delayed_job_test.yml
25+
with:
26+
versions: ${{ needs.ruby-versions.outputs.versions }}
27+
28+
opentelemetry-tests:
29+
needs: ruby-versions
30+
uses: ./.github/workflows/sentry_opentelemetry_test.yml
31+
with:
32+
versions: ${{ needs.ruby-versions.outputs.versions }}
33+
34+
rails-tests:
35+
needs: ruby-versions
36+
uses: ./.github/workflows/sentry_rails_test.yml
37+
with:
38+
versions: ${{ needs.ruby-versions.outputs.versions }}
39+
40+
resque-tests:
41+
needs: ruby-versions
42+
uses: ./.github/workflows/sentry_resque_test.yml
43+
with:
44+
versions: ${{ needs.ruby-versions.outputs.versions }}
45+
46+
ruby-tests:
47+
needs: ruby-versions
48+
uses: ./.github/workflows/sentry_ruby_test.yml
49+
with:
50+
versions: ${{ needs.ruby-versions.outputs.versions }}
51+
52+
sidekiq-tests:
53+
needs: ruby-versions
54+
uses: ./.github/workflows/sentry_sidekiq_test.yml
55+
with:
56+
versions: ${{ needs.ruby-versions.outputs.versions }}
57+
58+
codecov:
59+
name: CodeCov
60+
runs-on: ubuntu-latest
61+
needs:
62+
- ruby-tests
63+
- rails-tests
64+
- sidekiq-tests
65+
- delayed_job-tests
66+
- resque-tests
67+
- opentelemetry-tests
68+
steps:
69+
- uses: actions/checkout@v4
70+
71+
- name: Codecov
72+
uses: codecov/codecov-action@13ce06bfc6bbe3ecf90edbbf1bc32fe5978ca1d3
73+
with:
74+
run_command: send-notifications
75+
token: ${{ secrets.CODECOV_TOKEN }}

0 commit comments

Comments
 (0)