fix cog complexity on wordle setter index action #386
Workflow file for this run
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: Run Tests and Coverage | |
on: | |
pull_request: | |
branches: | |
- main | |
- prod | |
workflow_dispatch: | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: '3.3.5' | |
bundler-cache: true | |
- name: Install dependencies | |
run: bundle install | |
- name: Install Rails | |
run: gem install rails | |
- name: Run RSpec tests | |
run: bundle exec rspec | |
- name: Run Cucumber tests | |
run: bundle exec cucumber | |
- name: Upload coverage report | |
uses: actions/upload-artifact@v4 | |
with: | |
name: coverage-report | |
path: /home/runner/work/csce600-arcade/csce600-arcade/coverage | |
- name: Check Code Coverage | |
run: | | |
value=$(jq -r '.result.line' coverage/.last_run.json); | |
if (( $(echo "$value < 90" | bc -l) )); then | |
echo "::warning::Coverage is less than 90: $value" | |
exit -1 | |
fi | |