[DEV-12345] DO NOT MERGE - TESTING #98
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: CI | |
on: | |
pull_request: | |
types: [opened, edited, reopened, synchronize] | |
workflow_dispatch: | |
env: | |
GH_TOKEN: ${{ secrets.GIT_TOKEN_SECRET }} | |
OWNER: ${{ github.repository_owner }} | |
REPO: ${{ github.event.repository.name }} | |
PR_NUMBER: ${{ github.event.number }} | |
SONAR_HOST_URL: "https://sonarqube.trustly.one" | |
SONAR_TOKEN: ${{secrets.SONAR_TOKEN_SECRET}} | |
SONAR_PROJECT_KEY: "trustly-ios" | |
SONAR_PROJECT_NAME: "trustly-ios" | |
jobs: | |
SonarQube: | |
runs-on: macOS-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Install CocoaPods | |
run: | | |
gem install cocoapods | |
pod install --project-directory=Example | |
- name: Install SonarSource Build-Wrapper. | |
run: | | |
curl -L -o build-wrapper-macosx-x86.zip https://binaries.sonarsource.com/CommercialBuildWrapper/build-wrapper-macosx-x86.zip | |
unzip -o build-wrapper-macosx-x86.zip | |
chmod +x build-wrapper-macosx-x86/build-wrapper-macosx-x86 | |
export PATH=$PATH:$PWD/build-wrapper-macosx-x86 | |
which build-wrapper-linux-x86-64 | |
build-wrapper-macosx-x86 --version | |
cd build-wrapper-linux-x86 | |
ls -la | |
- name: Run Build with Build-Wrapper | |
run: | | |
# Run the build command with the build-wrapper to capture the build information | |
./build-wrapper-linux-x86/build-wrapper-linux-x86 --out-dir bw-output \ | |
xcodebuild -workspace Example/TrustlySDK.xcworkspace \ | |
-scheme TrustlySDK-Example \ | |
-configuration Debug \ | |
-destination 'platform=iOS Simulator,name=iPhone 15 Pro' | |
- name: Install sonar-scanner | |
run: | | |
brew install sonar-scanner | |
- name: Run SonarQube Analysis | |
run: | | |
sonar-scanner -X \ | |
-Dsonar.host.url=${SONAR_HOST_URL} \ | |
-Dsonar.login=${SONAR_TOKEN} \ | |
-Dsonar.projectKey=${SONAR_PROJECT_KEY} \ | |
-Dsonar.projectName=${SONAR_PROJECT_NAME} \ | |
-Dsonar.pullrequest.base="${{ github.base_ref }}" \ | |
-Dsonar.pullrequest.branch="${{ github.head_ref }}" \ | |
-Dsonar.pullrequest.key="${{ github.event.pull_request.number }}" \ | |
-Dsonar.scm.revision="${{ github.event.pull_request.head.sha }}" \ | |
-Dsonar.scm.disabled=true \ | |
-Dsonar.language=swift \ | |
-Dsonar.sources="." \ | |
-Dsonar.verbose=true \ | |
-Dsonar.cfamily.build-wrapper-output=bw-output | |