Skip to content

Commit

Permalink
ci: Fix mgmt of sonar coverage files in workflows + fix master scan w…
Browse files Browse the repository at this point in the history
…orkflow (#890)

Fix mgmt of sonar coverage files in workflows + fix master scan workflow
  • Loading branch information
jnewc authored Jun 5, 2024
1 parent 43d1ff8 commit 74142e1
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 10 deletions.
2 changes: 2 additions & 0 deletions .github/actions/sonar/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ runs:
- uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e #v4.1.7
with:
pattern: coverage-file-*
- shell: bash
run: mv coverage-file-*/sonar-coverage-*.xml ./
- name: Install Sonar
shell: bash
run: |
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/build-test-upload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,6 @@ jobs:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e #v4.1.7
with:
pattern: coverage-file-*
- run: mv coverage-file-*/sonar-coverage-*.xml ./
- name: SonarCloud Scan
uses: ./.github/actions/sonar
with:
Expand Down
45 changes: 39 additions & 6 deletions .github/workflows/test-and-code-quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ concurrency:
cancel-in-progress: true

jobs:
unit-tests:
sdk-unit-tests:
runs-on: macos-13-large
timeout-minutes: 20
name: "SDK - Unit Tests"
Expand All @@ -35,24 +35,57 @@ jobs:
fastlane-password: ${{ secrets.FASTLANE_PASSWORD }}
match-keychain-name: ${{ secrets.MATCH_KEYCHAIN_NAME }}
match-keychain-password: ${{ secrets.MATCH_KEYCHAIN_PASSWORD }}
sdk-name: sdk

optional-sdk-tests:
name: Optional SDK Tests
runs-on: macos-13-large
strategy:
max-parallel: 3
matrix:
package-swift:
- { name: 'nol-pay', file: 'Package.NolPay.swift' }
- { name: 'klarna', file: Package.Klarna.swift }
- { name: '3DS', file: Package.3DS.swift }
steps:
- name: Cancel previous jobs
uses: styfle/cancel-workflow-action@85880fa0301c86cca9da44039ee3bb12d3bedbfa # v0.12.1
with:
access_token: ${{ github.token }}
- name: Git - Checkout
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
with:
ref: ${{ github.ref }}
- name: Run SDK tests
uses: ./.github/actions/sdk-tests
with:
ssh-private-key: ${{ secrets.SSH_KEY }}
known-hosts: ${{ secrets.KNOWN_HOSTS }}
match-password: ${{ secrets.MATCH_PASSWORD }}
match-git-private-key: ${{ secrets.FASTLANE_PASSWORD }}
fastlane-session: ${{ secrets.FASTLANE_SESSION }}
fastlane-password: ${{ secrets.FASTLANE_PASSWORD }}
match-keychain-name: ${{ secrets.MATCH_KEYCHAIN_NAME }}
match-keychain-password: ${{ secrets.MATCH_KEYCHAIN_PASSWORD }}
sdk-name: ${{ matrix.package-swift.name }}
package-swift: ${{ matrix.package-swift.file }}


sonarcloud:
needs:
- unit-tests
- sdk-unit-tests
- optional-sdk-tests
runs-on: macos-13-large
name: SonarCloud
steps:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e #v4.1.7
with:
name: coverage-file-sdk
- name: SonarCloud Scan
uses: ./.github/actions/sonar
with:
github-token: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
sonar-token: ${{ secrets.SONAR_TOKEN }}
sonar-host: https://sonarcloud.io./
branch: ${{ github.head_ref }}
coverage-file-names: sonar-coverage-sdk.xml
coverage-file-names: sonar-coverage-sdk.xml,sonar-coverage-3DS.xml,sonar-coverage-nol-pay.xml,sonar-coverage-klarna.xml

0 comments on commit 74142e1

Please sign in to comment.