-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add github action * Remove travis * Add only rubocop * Setup CI: using local actions (#3) * Using local actions * Add RuboCop * Limit to push master and pr * Pull request only * No dependency on test * Using real ruby versions * Update ruby version * options for PG? * Start service * Split * Change service * with env * Remove host * Stop starting the service * Trying other config * idea * Adding password to env * real test script * Add cache * Add rubocop * Install in dedicated script * Fix * Fix fix * Fix fix fix * remove needs * Using doctolib actions * Using 9.6
- Loading branch information
Thomas Hareau
authored
Sep 18, 2020
1 parent
f5ee3c5
commit 3996f0e
Showing
2 changed files
with
72 additions
and
11 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,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.