Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run specs on GitHub Actions #3735

Draft
wants to merge 42 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
a466bdc
Add minimal spec running
lloeki Jun 25, 2024
9bd7793
Process prefixed CRuby versions in `rake appraisal` tasks
lloeki Jun 25, 2024
c69542e
Allow out-of-docker execution of `rake appraisal` tasks
lloeki Jun 25, 2024
30a863f
Disable simplecov + telemetry + remote configuration
lloeki Jun 25, 2024
d7c12be
Use `appraisal install` directly
lloeki Jun 25, 2024
532afc4
Add full inlined matrix
lloeki Jun 25, 2024
140a5e3
Disable some matrix elements
lloeki Jun 25, 2024
30ab3f5
Split workflow
lloeki Jun 25, 2024
fa98a09
Enable full matrix
lloeki Jun 25, 2024
cf38ddd
Extract spec matrix
lloeki Jun 26, 2024
c46d98f
Reduce hardcoded matrix for testing
lloeki Jun 26, 2024
3f0d220
Fix job name
lloeki Jun 26, 2024
5deec4c
Read YAML into JSON
lloeki Jun 26, 2024
6935f0d
Extract matrix from Rakefile
lloeki Jun 26, 2024
81c2beb
Use extracted matrix
lloeki Jun 26, 2024
f960fed
Force utf8
lloeki Jun 26, 2024
4e8ffeb
Remove container
lloeki Jun 26, 2024
411fbab
Use another image
lloeki Jun 26, 2024
05e334e
Fix encoding name
lloeki Jun 26, 2024
c9c0a07
Generate the expected matrix for GHA
lloeki Jun 26, 2024
ce58f3e
Add debugging output
lloeki Jun 26, 2024
5efabbf
Refine matrix.rb arguments
lloeki Jun 26, 2024
8020c47
Use ruby instead of missing jq
lloeki Jun 26, 2024
32f8193
Fix dependency on bash
lloeki Jun 27, 2024
5b92e6a
Nest each matrix dimension
lloeki Jun 27, 2024
b983afa
Move workflows to the right place
lloeki Jun 27, 2024
5b0387b
Remove runs-on for workflow callers
lloeki Jun 27, 2024
34543f6
Remove incorrect dependency
lloeki Jun 27, 2024
d0105e1
Add missing fromJSON
lloeki Jun 27, 2024
8fe4d18
Fix typos
lloeki Jun 27, 2024
5adb699
Fix overlooked references
lloeki Jun 27, 2024
a612357
Fix another overlooked key change
lloeki Jun 27, 2024
6fdc05d
Pass gemspec test about files
lloeki Jun 28, 2024
f55ee83
Work around for `dubious ownership` git error
lloeki Jun 28, 2024
5c7c899
Fold appraisal and bundle step together
lloeki Jun 28, 2024
133ae7e
Rename jobs
lloeki Jun 28, 2024
bfe39cf
Add aggregation job
lloeki Jun 28, 2024
9ce7122
Skip test on rubies where it's broken
lloeki Jun 28, 2024
0d795a1
Skip spec:main on ruby:3.4: frozen string literals
lloeki Jun 28, 2024
b40032a
Limit workflow parallelism
lloeki Sep 4, 2024
68db818
Generate a single templated workflow
lloeki Sep 10, 2024
4655ea7
Update gemfiles/*
lloeki Sep 10, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13,630 changes: 13,630 additions & 0 deletions .github/workflows/unit-test.yml

Large diffs are not rendered by default.

58 changes: 58 additions & 0 deletions .github/workflows/unit-test.yml.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Unit Test

on:
push:

jobs:
test:
name: "engine:${{ matrix.engine.name }}-${{ matrix.engine.version }}"
needs: matrix
strategy:
fail-fast: false
max-parallel: 8
matrix:
engine:
% matrix.engines.each do |engine|
- name: "<%= engine[:name] %>"
version: "<%= engine[:version] %>"
% end
steps:
%# install all appraisals
% matrix.to_a.each_with_object({}) { |e, h| (h[e[:spec][:appraisal]] ||= Set.new) << e[:engine] }.each do |appraisal, engines|
- name: Bundle install appraisal '<%= appraisal %>'
if: ${{ contains([matrix.engine.name, matrix.engine.version], fromJSON(<%= engines.map { |e| [e[:name], e[:version]] }.to_json %>)) }}
run: |
if [ -n "<%= appraisal %>" ]; then
BUNDLE_GEMFILE="gemfiles/${{ matrix.engine.name }}_${{ matrix.engine.version }}_$(echo "<%= appraisal %>" | tr '-' '_').gemfile"
elif [ "${{ matrix.engine.name }}" = "ruby" ]; then
BUNDLE_GEMFILE="Gemfile-${{ matrix.engine.version }}"
else
BUNDLE_GEMFILE="Gemfile-${{ matrix.engine.name }}-${{ matrix.engine.version }}"
fi
echo "BUNDLE_GEMFILE=${BUNDLE_GEMFILE}" >> $GITHUB_OUTPUT
env BUNDLE_GEMFILE="${BUNDLE_GEMFILE}" bundle install
% end
%# run tests
% matrix.to_a.each do |e|
- name: Run spec '<%= e[:spec][:name] %>' in '<%= e[:spec][:appraisal] %>'
if: ${{ [matrix.engine.name, matrix.engine.version] == fromJSON(<%= [e[:name], e[:version]].to_json %>) }}
run: |
if [ -n "<%= e[:spec][:appraisal] %>" ]; then
BUNDLE_GEMFILE="gemfiles/${{ matrix.engine.name }}_${{ matrix.engine.version }}_$(echo "<%= e[:spec][:appraisal] %>" | tr '-' '_').gemfile"
elif [ "${{ matrix.engine.name }}" = "ruby" ]; then
BUNDLE_GEMFILE="Gemfile-${{ matrix.engine.version }}"
else
BUNDLE_GEMFILE="Gemfile-${{ matrix.engine.name }}-${{ matrix.engine.version }}"
fi
echo "BUNDLE_GEMFILE=${BUNDLE_GEMFILE}" >> $GITHUB_OUTPUT
env BUNDLE_GEMFILE="${BUNDLE_GEMFILE}" bundle exec rake spec:<%= e[:spec][:name] %>
% end

aggregate:
name: spec:aggregate
runs-on: ubuntu-latest
needs: test
steps:
- name: NOOP
run: |
true
4 changes: 2 additions & 2 deletions Matrixfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
# rubocop:disable Layout/HashAlignment
{
'main' => {
'' => '✅ 2.5 / ✅ 2.6 / ✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ 3.3 / 3.4 / ✅ jruby',
'core-old' => '✅ 2.5 / ✅ 2.6 / ✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ 3.3 / 3.4 / ✅ jruby'
'' => '✅ 2.5 / ✅ 2.6 / ✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ 3.3 / 3.4 / ✅ jruby',
'core-old' => '✅ 2.5 / ✅ 2.6 / ✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ 3.3 / 3.4 / ✅ jruby'
},
'crashtracking' => {
'' => '✅ 2.5 / ✅ 2.6 / ✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ 3.3 / ✅ 3.4 / ❌ jruby',
Expand Down
5 changes: 5 additions & 0 deletions gemfiles/ruby_2.5_stripe_10.gemfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions gemfiles/ruby_2.5_stripe_11.gemfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions gemfiles/ruby_2.5_stripe_12.gemfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions gemfiles/ruby_2.5_stripe_7.gemfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions gemfiles/ruby_2.5_stripe_8.gemfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions gemfiles/ruby_2.5_stripe_9.gemfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions gemfiles/ruby_2.6_stripe_10.gemfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions gemfiles/ruby_2.6_stripe_11.gemfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions gemfiles/ruby_2.6_stripe_12.gemfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions gemfiles/ruby_2.6_stripe_7.gemfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions gemfiles/ruby_2.6_stripe_8.gemfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions gemfiles/ruby_2.6_stripe_9.gemfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions gemfiles/ruby_2.7_stripe_10.gemfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading