-
-
Notifications
You must be signed in to change notification settings - Fork 173
40 lines (32 loc) · 1.02 KB
/
unit-tests.yml
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
# This workflow will trigger on pull-request to main
# It will run the Swift Package tests, output the code coverage and upload it to Codecov.
name: Unit Tests
on:
# Trigger the workflow on push pull request or manually
pull_request:
branches: [ main ]
push:
branches: [ main ]
workflow_dispatch:
jobs:
run_tests:
name: Run tests and Get Code Coverage
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: Run tests
run: swift test --enable-code-coverage
- name: Test coverage
uses: maxep/[email protected]
with:
output-file: ./coverage/lcov.info
- name: Upload coverage to Codecov
if: ${{ github.event_name == 'push' }}
uses: codecov/codecov-action@v1
with:
file: ./coverage/lcov.info
token: ${{ secrets.CODECOV_TOKEN }}
flags: unittests
env_vars: SWIFT
name: codecov-${{ github.head_ref }}-${{ steps.date.outputs.date }}
fail_ci_if_error: true