Skip to content

Commit

Permalink
Update GitHub Actions workflows (#1253)
Browse files Browse the repository at this point in the history
* Update GitHub Actions from actions/checkout from v2 to v3
* Enable bundler-cache in ruby/setup-ruby
* Pass `BUNDLE_WITHOUT: development` to skip gems for development

Co-authored-by: Aaron Stone <aaron@serendipity.cx>
Co-authored-by: Josef Šimánek <josef.simanek@gmail.com>
  • Loading branch information
3 people authored Apr 26, 2022
1 parent 96f6102 commit ffdd8c6
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 22 deletions.
17 changes: 9 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,19 +47,20 @@ jobs:
# On the fail-fast: true, it cancels all in-progress jobs
# if any matrix job fails unlike Travis fast_finish.
fail-fast: false
env:
BUNDLE_WITHOUT: development
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Install openssl
if: matrix.os == 'macos-latest'
run: |
brew update
brew install openssl
# https://github.com/ruby/setup-ruby
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
- name: Install openssl
if: matrix.os == 'macos-latest'
run: |
brew update
brew install openssl
- run: ruby -v
- run: bundle install --without development
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- if: matrix.db != ''
run: echo 'DB=${{ matrix.db }}' >> $GITHUB_ENV
- run: sudo echo "127.0.0.1 mysql2gem.example.com" | sudo tee -a /etc/hosts
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
# if any matrix job fails unlike Travis fast_finish.
fail-fast: false
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- run: docker build -t mysql2 -f ci/Dockerfile_${{ matrix.distro }} --build-arg IMAGE=${{ matrix.image }} .
# Add the "--cap-add=... --security-opt seccomp=..." options
# as a temporary workaround to avoid the following issue
Expand Down
17 changes: 4 additions & 13 deletions .github/workflows/rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,14 @@ on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest

env:
BUNDLE_WITHOUT: development
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Ruby 2.4
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.4
- name: Cache gems
uses: actions/cache@v1
with:
path: vendor/bundle
key: ${{ runner.os }}-rubocop-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-rubocop-
- name: Install gems
run: |
bundle config path vendor/bundle
bundle install --jobs 4 --retry 3
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- name: Run RuboCop
run: bundle exec rubocop

0 comments on commit ffdd8c6

Please sign in to comment.