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

Fix CI failures by running Ruby <= 2.2 on older Ubuntu image #516

Merged
merged 3 commits into from
Jul 1, 2023
Merged
Changes from all commits
Commits
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
59 changes: 56 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
name: test on CI
on:
push:
branches: [ master ]
branches: [master]
pull_request:
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
ruby: [ "2.0", "2.1", "2.2", "2.3", "2.4", "2.5", "2.6", "2.7", "3.0", "3.1", "3.2", "head" ]
ruby: ["2.3", "2.4", "2.5", "2.6", "2.7", "3.0", "3.1", "3.2", "head"]
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗒️ "2.0", "2.1", "2.2" have been moved to the new test-legacy job.

steps:
- uses: actions/checkout@v3
- name: Set up Ruby
Expand All @@ -19,6 +19,33 @@ jobs:
- name: Run tests
run: bundle exec rake test:units

test-legacy:
runs-on: ubuntu-20.04
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗒️ Use the older Ubuntu runner that is compatible with Ruby "2.0", "2.1", "2.2"

strategy:
matrix:
ruby: ["2.0", "2.1", "2.2"]
steps:
- uses: actions/checkout@v3
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Run tests
run: bundle exec rake test:units

test-all:
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗒️ This aggregates all of the test* the matrix runs into a single check. That way the branch protection rule becomes much simpler.

runs-on: ubuntu-latest
needs: [test, test-legacy]
if: always()
steps:
- name: All tests ok
if: ${{ !(contains(needs.*.result, 'failure')) }}
run: exit 0
- name: Some tests failed
if: ${{ contains(needs.*.result, 'failure') }}
run: exit 1

rubocop:
runs-on: ubuntu-latest
steps:
Expand All @@ -35,7 +62,21 @@ jobs:
runs-on: macos-12
strategy:
matrix:
ruby: [ "2.0", "2.1", "2.2", "2.3", "2.4", "2.5", "2.6", "2.7", "3.0", "3.1", "3.2", "head" ]
ruby:
[
"2.0",
"2.1",
"2.2",
"2.3",
"2.4",
"2.5",
"2.6",
"2.7",
"3.0",
"3.1",
"3.2",
"head",
]
steps:
- uses: actions/checkout@v3

Expand All @@ -58,3 +99,15 @@ jobs:

- name: Run functional tests
run: bundle exec rake test:functional

functional-all:
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗒️ Likewise this aggregates all the functional* matrix runs into one check.

runs-on: ubuntu-latest
needs: [functional]
if: always()
steps:
- name: All tests ok
if: ${{ !(contains(needs.*.result, 'failure')) }}
run: exit 0
- name: Some tests failed
if: ${{ contains(needs.*.result, 'failure') }}
run: exit 1