Skip to content
This repository was archived by the owner on Feb 28, 2024. It is now read-only.

Commit 8a47e42

Browse files
Create sonar.yml
1 parent e1922ad commit 8a47e42

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

.github/workflows/sonar.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Sonar
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v2
15+
- name: Set up Ruby
16+
uses: ruby/setup-ruby@v1
17+
with:
18+
ruby-version: 2.7
19+
- name: Install dependencies
20+
run: |
21+
wget https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-3.3.0.1492.zip
22+
unzip sonar-scanner-cli-3.3.0.1492.zip
23+
bundle install --jobs=3 --retry=3
24+
- name: Run tests
25+
run: |
26+
gem build *.gemspec
27+
gem install *.gem
28+
rake test
29+
- name: Sonar
30+
env:
31+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
33+
run: |
34+
sonar-scanner-3.3.0.1492/bin/sonar-scanner \
35+
-Dsonar.projectName=oauth1-signer-ruby \
36+
-Dsonar.projectKey=Mastercard_oauth1-signer-ruby \
37+
-Dsonar.organization=mastercard \
38+
-Dsonar.sources=./lib \
39+
-Dsonar.tests=./tests \
40+
-Dsonar.ruby.coverage.reportPaths=coverage/.resultset.json \
41+
-Dsonar.host.url=https://sonarcloud.io \
42+
-Dsonar.login=$SONAR_TOKEN

0 commit comments

Comments
 (0)