Skip to content

Commit 2be09a5

Browse files
committed
Update build and tests action
1 parent 601f874 commit 2be09a5

File tree

2 files changed

+19
-45
lines changed

2 files changed

+19
-45
lines changed

.github/workflows/build-and-tests.yml

Lines changed: 18 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
runs-on: apps-ci
1616
timeout-minutes: 120
1717
steps:
18-
18+
1919
- name: Remove any previous hook 🥸
2020
run: rm -rf .git/hooks
2121

@@ -28,63 +28,37 @@ jobs:
2828
uses: actions/cache@v3
2929
with:
3030
path: |
31-
.gems
31+
.gems
3232
~/.bundle
3333
key: ${{ runner.os }}-cache-gems-${{ hashFiles('**/Gemfile.lock') }}
3434

3535
- name: Rake ⚙️
36-
run: arch -arm64 rake
37-
38-
- name: Run iOS tests ⚙️
39-
run: arch -arm64 bundle exec fastlane test_scheme scheme:Mini-iOS configuration:Debug name:iOS
36+
run: rake
4037

41-
- name: Upload coverage for iOS to Codecov 📋
42-
uses: codecov/codecov-action@v3.1.1
43-
with:
44-
token: ${{ secrets.CODECOV_TOKEN }}
45-
xcode: true
46-
xcode_archive_path: ./output/iOS/Mini-iOS.xcresult
47-
flags: ios
48-
fail_ci_if_error: true
49-
name: codecov-ios
50-
gcov_ignore: Tests/*
38+
- name: Run tests ⚙️
39+
run: rake test
5140

52-
- name: Run tvOS tests ⚙️
53-
run: arch -arm64 bundle exec fastlane test_scheme scheme:Mini-tvOS configuration:Debug name:tv
41+
- name: Generate lcov file 📈
42+
run: |
43+
xcrun llvm-cov export \
44+
-format="lcov" \
45+
--ignore-filename-regex=".build|.test-bundle|Tests/" \
46+
.build/debug/MiniPackageTests.xctest/Contents/MacOS/MiniPackageTests \
47+
-instr-profile .build/debug/codecov/default.profdata \
48+
> report.lcov
5449
55-
- name: Upload coverage for tvOS to Codecov 📋
50+
- name: Upload package tests coverage to Codecov 📋
5651
uses: codecov/codecov-action@v3.1.1
5752
with:
5853
token: ${{ secrets.CODECOV_TOKEN }}
59-
xcode: true
60-
xcode_archive_path: ./output/tv/Mini-tvOS.xcresult
61-
flags: tv
54+
files: report.lcov
55+
flags: package
6256
fail_ci_if_error: true
63-
name: codecov-tv
57+
name: codecov-package
6458
gcov_ignore: Tests/*
6559

66-
- name: Run mac tests ⚙️
67-
run: arch -arm64 bundle exec fastlane test_scheme scheme:Mini-macOS configuration:Debug name:mac
68-
69-
- name: Upload coverage for mac to Codecov 📋
70-
uses: codecov/codecov-action@v3.1.1
71-
with:
72-
token: ${{ secrets.CODECOV_TOKEN }}
73-
xcode: true
74-
xcode_archive_path: ./output/mac/Mini-macOS.xcresult
75-
flags: mac
76-
fail_ci_if_error: true
77-
name: codecov-mac
78-
gcov_ignore: Tests/*
79-
80-
- name: Danger 🚨
81-
run: bundle exec danger
82-
if: github.event_name == 'pull_request'
83-
env:
84-
DANGER_GITHUB_API_TOKEN: ${{ secrets.THORBOT_GITHUB_API_TOKEN }}
85-
8660
- name: Save Output 📦
8761
uses: actions/upload-artifact@v3
8862
with:
8963
name: output
90-
path: ${{ github.workspace }}/output
64+
path: ${{ github.workspace }}/report.lcov

Rakefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,5 @@ task(:setup) do
2222
end
2323

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

0 commit comments

Comments
 (0)