Skip to content

Hud visible with notch - Fix #145 #670

Hud visible with notch - Fix #145

Hud visible with notch - Fix #145 #670

Workflow file for this run

name: Build and Analyze
on:
pull_request:
paths:
- 'SlimHUD/**'
- 'SlimHUDTests/**'
- 'SlimHUDUITests/**'
push:
paths:
- '.github/**'
- 'SlimHUD/**'
- 'SlimHUDTests/**'
- 'SlimHUDUITests/**'
branches:
- develop
workflow_dispatch:
concurrency:
group: "unitests${{ github.head_ref || github.run_id }}"
cancel-in-progress: true
env:
test-results-check-name: Test results
jobs:
unit-tests-run:
runs-on: macos-12
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Switch Xcode version
run: sudo xcode-select -s "/Applications/Xcode_14.2.app"
- name: Build and Test
continue-on-error: true
id: run-tests
run: |
xcodebuild clean test \
-project SlimHUD.xcodeproj \
-scheme SlimHUD-GitHub-Action \
-destination platform=macOS \
-resultBundlePath TestResults \
-test-iterations 20 -retry-tests-on-failure \
CODE_SIGNING_ALLOWED=NO || exit 1
- name: Post test results
uses: AlexPerathoner/xcresulttool-alternative-action@v0.2
if: ${{ (success() || failure()) && github.event_name == 'pull_request' }}
with:
path: "TestResults.xcresult"
title: ${{ env.test-results-check-name }}
upload-bundles: never
show-code-coverage: true
- name: Generate coverage report
run: |
bash ./Configuration/xccov-to-sonarqube-generic.sh TestResults.xcresult/ > sonarqube-generic-coverage.xml
sed -i '' "s/projectVersion=1.0/projectVersion=$(xcrun agvtool what-version -terse) /g" sonar-project.properties
- name: Save coverage report
uses: actions/upload-artifact@master
with:
name: sonarqube-generic-coverage
path: sonarqube-generic-coverage.xml
- name: Checkout
uses: actions/checkout@v3
with:
# Disabling shallow clone is recommended for improving relevancy of reporting
fetch-depth: 0
- name: Replace version
run: sed -i '' "s/projectVersion=1.0/projectVersion=$(xcrun agvtool what-version -terse)/g" sonar-project.properties
# Following steps are broken in GH Action. Download the artifact and run manually if needed
# - uses: actions/download-artifact@master # download all previously generated artifacts
# with:
# name: sonarqube-generic-coverage
# # Setup java 17 to be default (sonar-scanner requirement as of 5.x)
# - uses: actions/setup-java@v3
# with:
# distribution: 'temurin' # See 'Supported distributions' for available options
# java-version: '17'
# - name: Setup sonarqube
# uses: warchant/setup-sonar-scanner@v7
# - name: Run sonarqube
# run: |
# sonar-scanner -X
# -Dsonar.login=${{ secrets.SONAR_TOKEN }}
- name: Check failures
# Flaky tests make the output status generated by xcresulttool not reliable. Using xcodebuild's status directly.
# This means that this workflow could and will fail if some test don't pass, even after retrying them
if: steps.run-tests.outcome != 'success'
run: exit 1