Skip to content
This repository has been archived by the owner on Mar 29, 2022. It is now read-only.

Commit

Permalink
Split CI test steps into dedicated workflows (#421)
Browse files Browse the repository at this point in the history
* Modify cibuild to only run RSpec

* Break up steps to run rubocop & rspec seperately

* Move rspec command into main.yml

* Split testing and linting into 2 workflows

* Update Build names

* Improve build name description

* Add build step, improve build name

* Improve build names once more

* Remove cibuild stem from linter

* Add install commands for dotenv & bundler

* Remove services from linter

* Gem install rubocop only

* Reset bundler command

* Ensure ENV vars can be shared across steps

* Rename Build Pipeline to Build
  • Loading branch information
Frida Casas committed Nov 11, 2019
1 parent 4cadd4e commit 5d0b0e9
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 47 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Rubocop Linter

on: [pull_request]

jobs:
verify:
name: Build
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- name: Set up Ruby 2.5.5
uses: actions/setup-ruby@v1
with:
ruby-version: 2.5.5
- name: Linting with Rubocop
run: |
sudo apt-get install libpq-dev
gem install bundler dotenv
bundle install --jobs 4 --retry 3
bundle exec rubocop
42 changes: 0 additions & 42 deletions .github/workflows/main.yml

This file was deleted.

45 changes: 45 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: RSpec Tests

on: [pull_request]

jobs:
verify:
name: Build
runs-on: ubuntu-latest

services:
postgres:
image: postgres:11.3
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
RAILS_ENV: test
PGHOST: localhost
PGUSER: postgres
PGDATABASE: hacktoberfest_test
END_DATE: "2019-10-01 00:00:00 UTC"
START_DATE: "2019-11-01 00:00:00 UTC"
TEST_USER_GITHUB_TOKEN: ${{ secrets.TEST_USER_GITHUB_TOKEN }}
GITHUB_CLIENT_ID: ${{ secrets.GITHUB_CLIENT_ID }}
GITHUB_CLIENT_SECRET: ${{ secrets.GITHUB_CLIENT_SECRET }}
AIRTABLE_APP_ID: ${{ secrets.AIRTABLE_APP_ID }}
AIRTABLE_API_KEY: ${{ secrets.AIRTABLE_API_KEY }}
SEGMENT_WRITE_KEY: ${{ secrets.SEGMENT_WRITE_KEY }}

steps:
- uses: actions/checkout@v1
- name: Set up Ruby 2.5.5
uses: actions/setup-ruby@v1
with:
ruby-version: 2.5.5
- name: Build
run: |
script/cibuild
- name: Testing with Rspec
run: |
bundle exec rspec
7 changes: 2 additions & 5 deletions script/cibuild
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ bundle install --jobs 4 --retry 3

script/setup

echo "Tests started at…"
date "+%H:%M:%S"
export RAILS_ENV="test" RACK_ENV="test"

# run tests

script/test
script/update

0 comments on commit 5d0b0e9

Please sign in to comment.