Skip to content

[DEV-000000] DO NOT MERGE IT - TESTING #38

[DEV-000000] DO NOT MERGE IT - TESTING

[DEV-000000] DO NOT MERGE IT - TESTING #38

name: CI - iOS
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: Generate sonar-project.properties
run: |
echo "sonar.login=${{ env.SONAR_TOKEN_SECRET }}" >> ./sonar-project.properties
- name: Install dependencies
run: |
# Update Homebrew
brew update
# Install SwiftLint
brew install swiftlint
# Install Tailor
brew install tailor
# Install xcpretty
sudo gem install -n /usr/local/bin xcpretty
# Install Lizard
brew install lizard
- name: Install SonarQube Scanner
run: |
SONAR_SCANNER_VERSION=5.0.1.3006
SONAR_SCANNER_DIR=/opt/sonar-scanner
curl -o sonar-scanner-cli.zip -L "https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-${SONAR_SCANNER_VERSION}-linux.zip"
sudo apt-get install -y unzip
unzip sonar-scanner-cli.zip
sudo mv sonar-scanner-${SONAR_SCANNER_VERSION}-linux ${SONAR_SCANNER_DIR}
echo "${SONAR_SCANNER_DIR}/bin" >> $GITHUB_PATH
echo "SonarScanner installed successfully!"
- name: Run Sonar-Swift Script
run: |
chmod +x ./run-sonar-swift.sh
./run-sonar-swift.sh -v
- name: Verify Coverage Report
run: |
if [ -f "sonar-reports/generic-coverage.xml" ]; then
echo "Coverage report generated successfully: sonar-reports/generic-coverage.xml"
else
echo "Coverage report not found!" && exit 1
fi