Merge pull request #125 from synyx/124-minimum-time #241
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: Analysis | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
analyze: | |
name: "SonarCloud" | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout source code | |
uses: actions/checkout@v3 | |
with: | |
# This is needed, so SonarCloud can analyze correctly the times when regressions were introduced | |
fetch-depth: 0 | |
- name: Set up Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: 2.7 | |
- name: Recreate Ruby Bundler cache | |
uses: actions/cache@v3 | |
with: | |
path: vendor/bundle | |
key: ${{ runner.os }}-analysis-bundler-${{ hashFiles('**/Gemfile*') }} | |
restore-keys: | | |
${{ runner.os }}-analysis-bundler- | |
- name: Install dependencies | |
run: bundle install --path ./vendor/bundle | |
- name: Run tests | |
run: bundle exec rspec | |
- name: Run rubocop | |
run: ./bin/rubocop_changes | |
continue-on-error: true | |
- name: Prepare simplecov report | |
run: ./bin/simplecov_18_17 coverage/.resultset.json > coverage/.resultset17.json | |
- name: SonarCloud Scan | |
uses: sonarsource/sonarcloud-github-action@master | |
with: | |
args: > | |
-Dsonar.organization=synyx | |
-Dsonar.projectKey=com.github.synyx:buchungsstreber | |
-Dsonar.ruby.coverage.reportPaths=/github/workspace/coverage/.resultset17.json | |
-Dsonar.sources=/github/workspace/bin/,/github/workspace/lib/ | |
-Dsonar.tests=/github/workspace/spec/ | |
-Dsonar.coverage.exclusions=**/tui.rb | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} |