Corrected cucumber scenarios #24
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
name: CI | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: ./rails_root | |
env: | |
RAILS_MASTER_KEY: ${{ secrets.RAILS_MASTER_KEY }} | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
bundler-cache: true | |
- name: Install dependencies | |
run: | | |
gem install bundler | |
bundle install --jobs 4 --retry 3 | |
- name: Run RSpec tests | |
if: '!cancelled()' | |
run: | | |
bundle exec rspec | |
- name: Run Cucumber tests | |
if: '!cancelled()' | |
run: | | |
bundle exec cucumber | |
- name: Generate SimpleCov report | |
if: '!cancelled()' | |
run: | | |
COVERAGE=true bundle exec rspec | |
COVERAGE=true bundle exec cucumber | |
- name: Upload coverage report | |
if: '!cancelled()' | |
uses: actions/upload-artifact@v3 | |
with: | |
name: coverage | |
path: coverage | |
- name: Rubocop Report | |
if: '!cancelled()' | |
run: | | |
echo "rubocop_offenses=$(rubocop | tail -n1 | awk '{print $4}')" >> "$GITHUB_ENV" | |
- name: Rubocop Badge Color | |
if: '!cancelled()' | |
run: | | |
echo "rubocop_badge_color=$([[ ${{env.rubocop_offenses}} -gt 0 ]] && echo 'red' || echo 'green')" >> "$GITHUB_ENV" | |
- name: Rubocop Badge | |
if: '!cancelled()' | |
uses: schneegans/dynamic-badges-action@v1.7.0 | |
with: | |
auth: ${{ secrets.GIST_SECRET }} | |
gistID: ${{ secrets.GIST_ID }} | |
filename: badge.json | |
label: 'Rubocop' | |
message: '${{ env.rubocop_offenses }} offenses' | |
color: ${{ env.rubocop_badge_color }} | |
- name: Upload coverage report to CodeClimate | |
if: '!cancelled()' | |
uses: paambaati/codeclimate-action@v3.1.1 | |
env: | |
CC_TEST_REPORTER_ID: c65072aca2cabde6c5f61913e0a45910a273d78e1a309c785a64de223b1c21af | |
with: | |
coverageLocations: ${{ github.workspace }}/**/coverage.json:simplecov | |
debug: true |