-
Notifications
You must be signed in to change notification settings - Fork 186
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate from Travis CI to GitHub Actions
- Loading branch information
Showing
2 changed files
with
67 additions
and
1 deletion.
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,66 @@ | ||
# This workflow uses actions that are not certified by GitHub. | ||
# They are provided by a third-party and are governed by | ||
# separate terms of service, privacy policy, and support | ||
# documentation. | ||
# This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake | ||
# For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby | ||
|
||
name: Ruby | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
branches: [ master ] | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
env: | ||
DATABASE_URL: mysql2://root:@127.0.0.1:3306/wca_test | ||
RACK_ENV: test | ||
defaults: | ||
run: | ||
working-directory: WcaOnRails | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Activate MySQL # as per https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu2004-README.md#mysql | ||
run: | | ||
sudo systemctl start mysql.service | ||
mysql -e "ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '';" -u root -proot | ||
- name: Set up Ruby | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: 2.5.3 | ||
bundler-cache: true # runs 'bundle install' and caches installed gems automatically | ||
- name: Update Bundler workaround | ||
run: | | ||
yes | gem update --system | ||
yes | gem update bundler | ||
- uses: actions/setup-node@v2 # this also includes Yarn | ||
with: | ||
node-version: '12' | ||
- uses: actions/cache@v2 | ||
with: | ||
path: '**/node_modules' | ||
key: ${{ runner.os }}-node_modules-${{ hashFiles('**/yarn.lock') }} | ||
# restore-keys: | | ||
# ${{ runner.os }}-node_modules | ||
- uses: actions/cache@v2 | ||
with: | ||
path: '~/.cache/yarn' | ||
key: ${{ runner.os }}-yarn | ||
- uses: actions/cache@v2 | ||
with: | ||
path: '~/.phantomjs' | ||
key: ${{ runner.os }}-phantomjs | ||
- name: Populate database with seeds | ||
run: bundle exec rake db:reset | ||
- name: Pre-compile assets for frontend tests | ||
env: | ||
DISABLE_SPRING: 1 | ||
run: bundle exec rake assets:precompile | ||
- name: Run Overcommit commit hooks | ||
run: bundle exec overcommit --sign && bundle exec overcommit --sign pre-commit && (cd .. && BUNDLE_GEMFILE=WcaOnRails/Gemfile bundle exec overcommit --run) | ||
- name: Run tests | ||
run: bundle exec rake |
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