-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add github action #17
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
55b9dd2
Add github action
5cd6422
Remove travis
3eeb912
Merge pull request #1 from ThHareau/create-workflow
ThHareau 40be4f0
Add only rubocop
98e7c00
Merge pull request #2 from ThHareau/create-workflow
ThHareau 3dd8ecf
Setup CI: using local actions (#3)
ThHareau 41a2851
Using doctolib actions
2651da2
Using 9.6
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,72 @@ | ||
env: | ||
RUBY_VERSION: 2.6.x | ||
POSTGRES_USER: postgres | ||
POSTGRES_PASSWORD: postgres | ||
POSTGRES_DB: safe_pg_migrations_test | ||
PGPASSWORD: postgres | ||
|
||
name: Rake tests | ||
on: pull_request | ||
|
||
jobs: | ||
rubocop-test: | ||
name: Rubocop | ||
runs-on: ubuntu-18.04 | ||
steps: | ||
- uses: doctolib/checkout@v1 | ||
- uses: doctolib/setup-ruby@v1 | ||
with: | ||
ruby-version: ${{ env.RUBY_VERSION }} | ||
- uses: doctolib/cache@v2 | ||
with: | ||
path: vendor/bundle | ||
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-gems- | ||
- name: bundle | ||
run: | | ||
gem install bundler | ||
bundle config path vendor/bundle | ||
bundle install --jobs 4 --retry 3 | ||
- name: Install Rubocop | ||
run: gem install rubocop | ||
- name: Check code | ||
run: bundle exec rubocop | ||
unit-test: | ||
name: UnitTest | ||
runs-on: ubuntu-18.04 | ||
# Service containers to run with `container-job` | ||
services: | ||
postgres: | ||
image: postgres:9.6 | ||
env: | ||
POSTGRES_DB: safe_pg_migrations_test | ||
POSTGRES_PASSWORD: postgres | ||
POSTGRES_USER: postgres | ||
ports: | ||
- 5432:5432 | ||
# Set health checks to wait until postgres has started | ||
options: >- | ||
--health-cmd pg_isready | ||
--health-interval 10s | ||
--health-timeout 5s | ||
--health-retries 5 | ||
steps: | ||
- uses: doctolib/checkout@v1 | ||
- name: Set up Ruby | ||
uses: doctolib/setup-ruby@v1 | ||
with: | ||
ruby-version: ${{ env.RUBY_VERSION }} | ||
- uses: doctolib/cache@v2 | ||
with: | ||
path: vendor/bundle | ||
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-gems- | ||
- name: bundle | ||
run: | | ||
gem install bundler | ||
bundle config path vendor/bundle | ||
bundle install --jobs 4 --retry 3 | ||
- name: Run tests | ||
run: bundle exec rake test |
This file was deleted.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've tried to move this part here in an independent action, but as document in actions/runner#438 it is not yet possible to use other actions in composite actions.
Apparently github is working on it, once done we could have an internal action in a repo that we can use in any of our repo.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That would also make the file a lot shorter :)