forked from matthewrudy/memoist
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
2813587 Replace CircleCI with GitHub Actions
- Loading branch information
1 parent
d7e4883
commit 9b6363d
Showing
2 changed files
with
65 additions
and
57 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
name: Test and Build | ||
on: | ||
push: | ||
|
||
jobs: | ||
verify_gemfile_lock: | ||
runs-on: ubuntu-latest | ||
env: | ||
BUNDLE_RUBYGEMS__PKG__GITHUB__COM: ${{ secrets.GITHUB_TOKEN }} | ||
steps: | ||
- name: checkout | ||
uses: actions/[email protected] | ||
|
||
- name: setup ruby | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: ${{ env.RUBY_VERSION }} | ||
bundler-cache: true # runs 'bundle install' and caches installed gems | ||
- name: bundler | ||
shell: bash | ||
run: |- | ||
gem install bundler -v $(grep 'BUNDLED WITH' Gemfile.lock -A 1|tail -1) | ||
bundle config path vendor/bundle | ||
bundle install --jobs 4 --retry 3 | ||
- name: Verify Gemfile.lock | ||
shell: bash | ||
run: |- | ||
if git diff-index --quiet HEAD -- Gemfile.lock | ||
then | ||
exit 0 | ||
else | ||
echo "Please ensure that you have bundled and committed any" | ||
echo "resulting changes to the Gemfile.lock file in this repo." | ||
git --no-pager diff -- Gemfile.lock | ||
exit 128 | ||
fi | ||
test_and_build: | ||
runs-on: ubuntu-latest | ||
env: | ||
BUNDLE_RUBYGEMS__PKG__GITHUB__COM: ${{ secrets.GITHUB_TOKEN }} | ||
steps: | ||
- name: checkout | ||
uses: actions/[email protected] | ||
|
||
- name: setup ruby | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
bundler-cache: true # runs 'bundle install' and caches installed gems automatically | ||
|
||
- name: bundler | ||
shell: bash | ||
run: |- | ||
gem install bundler -v $(grep 'BUNDLED WITH' Gemfile.lock -A 1|tail -1) | ||
bundle config path vendor/bundle | ||
bundle install --jobs 4 --retry 3 | ||
- name: specs | ||
shell: bash | ||
run: |- | ||
# Run specs to ensure build is passing | ||
bundle exec rake test | ||
# Run rake build to ensure gem will build | ||
bundle exec rake build |