-
-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #52 from rspec/setup-github-actions
Setup github actions
- Loading branch information
Showing
7 changed files
with
126 additions
and
31 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
name: RSpec CI | ||
on: | ||
push: | ||
branches: | ||
- 'main' | ||
- '*-maintenance' | ||
- '*-dev' | ||
- 'pr-*' | ||
pull_request: | ||
branches: | ||
- '*' | ||
permissions: | ||
contents: read | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.github.head_ref || github.run_id }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
test: | ||
name: 'Ruby: ${{ matrix.ruby }}, Rails: ${{ matrix.env.RAILS_VERSION }}' | ||
runs-on: ubuntu-20.04 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- ruby: '3.2' | ||
- ruby: '3.1' | ||
- ruby: '3.0' | ||
- ruby: 2.7 | ||
- ruby: 2.6 | ||
- ruby: 2.5 | ||
- ruby: 2.3 | ||
- ruby: 2.2 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: ${{ matrix.ruby }} | ||
- run: script/update_rubygems_and_install_bundler | ||
- run: bundle install --binstubs | ||
- run: script/run_build | ||
|
||
legacy: | ||
name: Legacy Ruby Builds (${{ matrix.container.version }}) | ||
runs-on: ubuntu-20.04 | ||
container: | ||
image: ${{ matrix.container.tag }} | ||
options: ${{ matrix.container.options || '--add-host github-complains-if-this-is-empty.com:127.0.0.1' }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- container: | ||
version: "2.1.9" | ||
tag: ghcr.io/rspec/docker-ci:2.1.9 | ||
post: git config --global --add safe.directory `pwd` | ||
- container: | ||
version: "2.0" | ||
tag: ghcr.io/rspec/docker-ci:2.0.0 | ||
- container: | ||
version: "1.9.3" | ||
tag: ghcr.io/rspec/docker-ci:1.9.3 | ||
env: | ||
LEGACY_CI: true | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- run: script/legacy_setup.sh | ||
- run: ${{ matrix.container.post }} | ||
- run: script/run_build |
This file was deleted.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/bin/bash | ||
# This file was generated on 2023-06-26T13:27:27+01:00 from the rspec-dev repo. | ||
# DO NOT modify it by hand as your changes will get lost the next time it is generated. | ||
|
||
set -e | ||
|
||
bundle install --standalone --binstubs --without coverage documentation | ||
|
||
if [ -x ./bin/rspec ]; then | ||
echo "RSpec bin detected" | ||
else | ||
if [ -x ./exe/rspec ]; then | ||
cp ./exe/rspec ./bin/rspec | ||
echo "RSpec restored from exe" | ||
else | ||
echo "No RSpec bin available" | ||
exit 1 | ||
fi | ||
fi |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
function is_ruby_31_plus { | ||
if ruby -e "exit(RUBY_VERSION.to_f >= 3.1)"; then | ||
return 0 | ||
else | ||
return 1 | ||
fi | ||
} | ||
|
||
function is_ruby_23_plus { | ||
if ruby -e "exit(RUBY_VERSION.to_f >= 2.3)"; then | ||
return 0 | ||
else | ||
return 1 | ||
fi | ||
} | ||
|
||
if is_ruby_31_plus; then | ||
echo "Installing rubygems 3.3.6 / bundler 2.3.6" | ||
yes | gem update --system '3.3.6' | ||
yes | gem install bundler -v '2.3.6' | ||
elif is_ruby_23_plus; then | ||
echo "Installing rubygems 3.2.22 / bundler 2.2.22" | ||
yes | gem update --system '3.2.22' | ||
yes | gem install bundler -v '2.2.22' | ||
else | ||
echo "Warning installing older versions of Rubygems / Bundler" | ||
gem update --system '2.7.8' | ||
gem install bundler -v '1.17.3' | ||
fi |