-
Notifications
You must be signed in to change notification settings - Fork 1
52 lines (41 loc) · 1.34 KB
/
ci.yml
File metadata and controls
52 lines (41 loc) · 1.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
name: CI
on:
workflow_dispatch:
push:
branches:
- main
pull_request:
types: [opened, reopened, synchronize]
branches:
- '*'
jobs:
build-and-test:
name: Build, Test, & Report Coverage
runs-on: macos-latest
steps:
- name: Checkout source code
uses: actions/checkout@v4
- name: Set up Xcode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest
- name: Install Brewfile dependencies
run: brew bundle install
- name: Run SwiftFormat in lint mode
run: swiftformat --lint .
- name: Install package dependencies
run: swift package resolve
- name: Build the package
run: swift build
- name: Run tests with code coverage
run: swift test --enable-code-coverage
- name: Gather code coverage
run: xcrun llvm-cov export -format="lcov" .build/debug/SwiftSyntaxSugarPackageTests.xctest/Contents/MacOS/SwiftSyntaxSugarPackageTests -instr-profile .build/debug/codecov/default.profdata > coverage_report.lcov
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
files: coverage_report.lcov
token: ${{ secrets.CODECOV_TOKEN }}
slug: fetch-rewards/SwiftSyntaxSugar
verbose: true
fail_ci_if_error: true