Skip to content

Commit 7589894

Browse files
authored
Add CI workflow (#51)
Signed-off-by: Gray Campbell <12163070+graycampbell@users.noreply.github.com>
1 parent 9acedf8 commit 7589894

File tree

2 files changed

+48
-0
lines changed

2 files changed

+48
-0
lines changed

.github/workflows/ci.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: CI
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- main
8+
pull_request:
9+
branches:
10+
- '*'
11+
12+
jobs:
13+
build-and-test:
14+
name: Build, Test, & Report Coverage
15+
runs-on: macos-latest
16+
17+
steps:
18+
- name: Checkout source code
19+
uses: actions/checkout@v4
20+
21+
- name: Set up Xcode
22+
uses: maxim-lobanov/setup-xcode@v1
23+
with:
24+
xcode-version: latest
25+
26+
- name: Install dependencies
27+
run: swift package resolve
28+
29+
- name: Build the package
30+
run: swift build
31+
32+
- name: Run tests with code coverage
33+
run: swift test --enable-code-coverage
34+
35+
- name: Gather code coverage
36+
run: xcrun llvm-cov export -format="lcov" .build/debug/SwiftSyntaxSugarPackageTests.xctest/Contents/MacOS/SwiftSyntaxSugarPackageTests -instr-profile .build/debug/codecov/default.profdata > coverage_report.lcov
37+
38+
- name: Upload coverage to Codecov
39+
uses: codecov/codecov-action@v5
40+
with:
41+
files: coverage_report.lcov
42+
token: ${{ secrets.CODECOV_TOKEN }}
43+
slug: fetch-rewards/SwiftSyntaxSugar
44+
verbose: true
45+
fail_ci_if_error: true

codecov.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
coverage:
2+
ignore:
3+
- Tests/*

0 commit comments

Comments
 (0)