Merge pull request #827 from weblate/weblate-meetingbar-app #1381
Workflow file for this run
This file contains hidden or 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: Test | |
on: | |
push: | |
paths: | |
- '**/*.swift' | |
pull_request: | |
paths: | |
- '**/*.swift' | |
jobs: | |
Tests: | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v4 | |
# Cache DerivedData for faster builds | |
- name: Cache DerivedData | |
uses: actions/cache@v4 | |
with: | |
path: ~/Library/Developer/Xcode/DerivedData | |
key: ${{ runner.os }}-deriveddata-${{ github.sha }} | |
restore-keys: | | |
${{ runner.os }}-deriveddata- | |
# Cache RubyGems for Slather (if Gemfile is present) | |
- name: Cache RubyGems | |
uses: actions/cache@v4 | |
with: | |
path: vendor/bundle | |
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }} | |
restore-keys: | | |
${{ runner.os }}-gems- | |
- name: List available Xcode versions | |
run: ls /Applications | grep Xcode | |
- name: Select Xcode 16.2 | |
run: sudo xcode-select -s /Applications/Xcode_16.2.app/Contents/Developer | |
- name: Show current version of Xcode | |
run: xcodebuild -version | |
- name: Install xcpretty | |
run: gem install xcpretty | |
- name: Run Tests & Generate JUnit | |
shell: bash | |
run: | | |
set -o pipefail | |
xcodebuild \ | |
-scheme MeetingBar \ | |
-configuration Debug \ | |
-enableCodeCoverage YES \ | |
build test \ | |
CODE_SIGN_IDENTITY="" \ | |
CODE_SIGNING_REQUIRED=NO \ | |
| xcpretty --report junit --output build/test-results/report.junit.xml | |
- name: Publish Test Results | |
uses: dorny/test-reporter@v2 | |
if: always() | |
with: | |
name: MeetingBar Tests | |
path: build/test-results/*.xml | |
reporter: jest-junit | |
- name: Install Slather | |
run: gem install slather | |
- name: Generate Coverage Report | |
shell: bash | |
run: | | |
slather coverage \ | |
--scheme MeetingBar \ | |
--cobertura-xml \ | |
--output-directory build/coverage \ | |
MeetingBar.xcodeproj | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v5 | |
if: always() | |
with: | |
files: build/coverage/cobertura.xml | |
fail_ci_if_error: true | |
token: ${{ secrets.CODECOV_TOKEN }} | |
- name: Upload test results to Codecov | |
if: ${{ !cancelled() }} | |
uses: codecov/test-results-action@v1 | |
with: | |
directory: build/test-results | |
token: ${{ secrets.CODECOV_TOKEN }} |