-
Notifications
You must be signed in to change notification settings - Fork 436
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
With a workflow in GitHub Actions to detect potential issues with the next Rails version. It's not possible to use CircleCI since we can't filter PRs based on their branch name. The module RailsVersion is to help with migrating code to a newer Rails version.
- Loading branch information
Dany Marcoux
committed
Apr 20, 2021
1 parent
b38d311
commit 461c85e
Showing
8 changed files
with
645 additions
and
4 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,45 @@ | ||
name: Continuous integration for next Rails version | ||
|
||
on: | ||
# Run this workflow on the branch master and any upstream (not from a fork) branch starting with the prefix next_rails- | ||
push: | ||
branches: | ||
- master | ||
- 'next_rails-*' | ||
# Run this workflow on PRs from any upstream (not from a fork) branch starting with the prefix next_rails- | ||
pull_request: | ||
branches: | ||
- 'next_rails-*' | ||
|
||
jobs: | ||
next_rails: | ||
runs-on: ubuntu-20.04 # This is required, but we're running all steps in the container defined below | ||
container: | ||
image: registry.opensuse.org/obs/server/unstable/container/ci/containers/openbuildservice/frontend-base:latest | ||
env: | ||
NOKOGIRI_USE_SYSTEM_LIBRARIES: 1 | ||
options: --user frontend | ||
services: | ||
database: | ||
image: registry.opensuse.org/obs/server/unstable/container/ci/containers/openbuildservice/mariadb:latest | ||
# TODO: How to change the command of a service container? | ||
# command: | | ||
# /bin/bash -c 'echo -e "[mysqld]\ndatadir = /dev/shm" > /etc/my.cnf.d/obs.cnf && cp -a /var/lib/mysql/* /dev/shm && /usr/lib/mysql/mysql-systemd-helper start' | ||
options: --name db | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
- name: Install dependencies | ||
uses: ruby/setup-ruby@v1 | ||
- name: Install dependencies from src/api/Gemfile.next | ||
run: cd ./src/api && && next bundle install --jobs=4 --retry=3 | ||
- name: Init submodule | ||
run: git submodule update --init --recursive --remote | ||
- name: Wait for DB | ||
run: mysqladmin ping -h db | ||
- name: Create database with next Rails version | ||
run: cd src/api; next bundle exec rake db:setup RAILS_ENV=test | ||
- name: Run specs | ||
run: cd src/api && next bundle exec rspec --format progress --format RspecJunitFormatter -o /home/frontend/rspec/rspec.db.xml | ||
- name: Run minitest test suite | ||
run: cd src/api && next bundle exec rake test:api:group1 test:api:group2 |
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
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 @@ | ||
Gemfile |
Oops, something went wrong.