-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
210 additions
and
64 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
name: 'Run SDK tests' | ||
description: 'Test the SDK using SPM' | ||
inputs: | ||
ssh-private-key: | ||
description: SSH private key | ||
required: true | ||
known-hosts: | ||
description: Known Hosts | ||
required: true | ||
match-password: | ||
description: Match password | ||
required: true | ||
match-git-private-key: | ||
description: Match git private key | ||
required: true | ||
fastlane-password: | ||
description: Fastlane password | ||
required: true | ||
fastlane-session: | ||
description: Fastlane session | ||
required: true | ||
match-keychain-name: | ||
description: Match keychain name | ||
required: true | ||
match-keychain-password: | ||
description: Match keychain password | ||
required: true | ||
source-branch: | ||
description: Source branch | ||
required: true | ||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Select Xcode Version | ||
uses: maxim-lobanov/setup-xcode@60606e260d2fc5762a71e64e74b2174e8ea3c8bd # v1.6.0 | ||
with: | ||
xcode-version: '15.2' | ||
- name: Install SSH key | ||
uses: shimataro/ssh-key-action@d4fffb50872869abe2d9a9098a6d9c5aa7d16be4 #v2.7.0 | ||
with: | ||
key: ${{ inputs.ssh-private-key }} | ||
name: id_rsa_github_actions | ||
known_hosts: ${{ inputs.known-hosts }} | ||
- uses: webfactory/ssh-agent@dc588b651fe13675774614f8e6a936a468676387 # v0.9.0 | ||
with: | ||
ssh-private-key: ${{ inputs.ssh-private-key }} | ||
- uses: ruby/setup-ruby@d4526a55538b775af234ba4af27118ed6f8f6677 # v1.172.0 | ||
with: | ||
ruby-version: "3.2" | ||
bundler-cache: true | ||
- name: Build SPM App | ||
shell: bash | ||
run: | | ||
bundle exec fastlane test_spm | ||
env: | ||
MATCH_PASSWORD: ${{ inputs.match-password }} | ||
MATCH_GIT_PRIVATE_KEY: ${{ inputs.ssh-private-key }} | ||
FASTLANE_PASSWORD: ${{ inputs.fastlane-password }} | ||
FASTLANE_SESSION: ${{ inputs.fastlane-session }} | ||
MATCH_KEYCHAIN_NAME: ${{ inputs.match-keychain-name }} | ||
MATCH_KEYCHAIN_PASSWORD: ${{ inputs.match-password }} | ||
SOURCE_BRANCH: ${{ inputs.source-branch }} | ||
- name: Prepare coverage reports | ||
shell: bash | ||
run: | | ||
bash Scripts/xccov-to-sonarqube-generic.sh fastlane/test_output/PrimerSDKTests.xcresult/ > coverage.xml | ||
sed "s#$PWD/##g" coverage.xml > coverage_cleaned.xml | ||
- uses: actions/upload-artifact@master | ||
with: | ||
name: coverage-file | ||
path: coverage_cleaned.xml |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: 'Run Sonar tests' | ||
description: 'Upload code quality scans to Sonar' | ||
inputs: | ||
github-token: | ||
description: GitHub token | ||
required: true | ||
sonar-token: | ||
description: Sonar token | ||
required: true | ||
sonar-host | ||
description: Sonar host URL | ||
required: true | ||
runs: | ||
using: "composite" | ||
steps: | ||
- uses: actions/download-artifact@master | ||
with: | ||
name: coverage-file | ||
- name: Update sonar-project.properties | ||
shell: bash | ||
run: | | ||
echo "sonar.pullrequest.key=${{github.event.pull_request.number}}" >> sonar-project.properties | ||
echo "sonar.pullrequest.branch=${{github.head_ref}}" >> sonar-project.properties | ||
echo "sonar.pullrequest.base=${{github.base_ref}}" >> sonar-project.properties | ||
echo "sonar.scm.revision=${{ github.event.pull_request.head.sha }}" >> sonar-project.properties | ||
- name: SonarCloud Scan | ||
uses: sonarsource/sonarqube-scan-action@master | ||
env: | ||
GITHUB_TOKEN: ${{ inputs.github-token }} # Needed to get PR information, if any | ||
SONAR_TOKEN: ${{ inputs.sonar-token }} | ||
SONAR_HOST_URL: ${{ inputs.sonar-host }} | ||
- name: SonarQube Quality Gate check | ||
id: sonarqube-quality-gate-check | ||
uses: sonarsource/sonarqube-quality-gate-action@master | ||
timeout-minutes: 5 | ||
env: | ||
SONAR_TOKEN: ${{ inputs.sonar-token }} | ||
SONAR_HOST_URL: ${{ inputs.sonar-host }} |
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
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
name: Test SDK and upload Code Quality metrics | ||
|
||
on: | ||
push: | ||
branch: | ||
- master | ||
|
||
concurrency: | ||
group: ${{ github.ref }}-tests | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
sdk-unit-tests: | ||
runs-on: macos-13-large | ||
timeout-minutes: 20 | ||
name: "SDK - Unit Tests" | ||
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@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | ||
with: | ||
ref: ${{ github.ref }} | ||
- name: Run SDK tests | ||
uses: ./.github/actions/sdk-tests | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
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 }} | ||
|
||
sonarcloud: | ||
needs: | ||
- sdk-unit-tests | ||
name: SonarCloud | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | ||
with: | ||
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis | ||
- uses: actions/download-artifact@master | ||
with: | ||
name: coverage-file | ||
- name: Update sonar-project.properties | ||
run: | | ||
echo "sonar.pullrequest.key=${{github.event.pull_request.number}}" >> sonar-project.properties | ||
echo "sonar.pullrequest.branch=${{github.head_ref}}" >> sonar-project.properties | ||
echo "sonar.pullrequest.base=${{github.base_ref}}" >> sonar-project.properties | ||
echo "sonar.scm.revision=${{ github.event.pull_request.head.sha }}" >> sonar-project.properties | ||
- 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./ |
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
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