Skip to content

Commit

Permalink
Update build and tests action
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianrl committed Nov 21, 2024
1 parent 601f874 commit 2be09a5
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 45 deletions.
62 changes: 18 additions & 44 deletions .github/workflows/build-and-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
runs-on: apps-ci
timeout-minutes: 120
steps:

- name: Remove any previous hook 🥸
run: rm -rf .git/hooks

Expand All @@ -28,63 +28,37 @@ jobs:
uses: actions/cache@v3
with:
path: |
.gems
.gems
~/.bundle
key: ${{ runner.os }}-cache-gems-${{ hashFiles('**/Gemfile.lock') }}

- name: Rake ⚙️
run: arch -arm64 rake

- name: Run iOS tests ⚙️
run: arch -arm64 bundle exec fastlane test_scheme scheme:Mini-iOS configuration:Debug name:iOS
run: rake

- name: Upload coverage for iOS to Codecov 📋
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}
xcode: true
xcode_archive_path: ./output/iOS/Mini-iOS.xcresult
flags: ios
fail_ci_if_error: true
name: codecov-ios
gcov_ignore: Tests/*
- name: Run tests ⚙️
run: rake test

- name: Run tvOS tests ⚙️
run: arch -arm64 bundle exec fastlane test_scheme scheme:Mini-tvOS configuration:Debug name:tv
- name: Generate lcov file 📈
run: |
xcrun llvm-cov export \
-format="lcov" \
--ignore-filename-regex=".build|.test-bundle|Tests/" \
.build/debug/MiniPackageTests.xctest/Contents/MacOS/MiniPackageTests \
-instr-profile .build/debug/codecov/default.profdata \
> report.lcov
- name: Upload coverage for tvOS to Codecov 📋
- name: Upload package tests coverage to Codecov 📋
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}
xcode: true
xcode_archive_path: ./output/tv/Mini-tvOS.xcresult
flags: tv
files: report.lcov
flags: package
fail_ci_if_error: true
name: codecov-tv
name: codecov-package
gcov_ignore: Tests/*

- name: Run mac tests ⚙️
run: arch -arm64 bundle exec fastlane test_scheme scheme:Mini-macOS configuration:Debug name:mac

- name: Upload coverage for mac to Codecov 📋
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}
xcode: true
xcode_archive_path: ./output/mac/Mini-macOS.xcresult
flags: mac
fail_ci_if_error: true
name: codecov-mac
gcov_ignore: Tests/*

- name: Danger 🚨
run: bundle exec danger
if: github.event_name == 'pull_request'
env:
DANGER_GITHUB_API_TOKEN: ${{ secrets.THORBOT_GITHUB_API_TOKEN }}

- name: Save Output 📦
uses: actions/upload-artifact@v3
with:
name: output
path: ${{ github.workspace }}/output
path: ${{ github.workspace }}/report.lcov
2 changes: 1 addition & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ task(:setup) do
end

task(:tests) do
sh('swift test')
sh('swift test --enable-code-coverage --disable-swift-testing -v')
end

0 comments on commit 2be09a5

Please sign in to comment.