Skip to content

Add bulid and test workflow #1

Add bulid and test workflow

Add bulid and test workflow #1

name: Build and Test
on:
push:
branches:
- main
paths-ignore:
- 'README.md'
- 'LICENSE'
- 'docs/**'
pull_request:
branches:
- main
paths-ignore:
- 'README.md'
- 'LICENSE'
- 'docs/**'
jobs:
build:
name: Build and Test
runs-on: macos-13
env:
PACKAGE_NAME: Stubby
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Build
run: swift build
- name: Test
run: swift test --enable-code-coverage
- name: Prepare Code Coverage
run: xcrun llvm-cov export -format="lcov" .build/debug/${{ env.PACKAGE_NAME }}PackageTests.xctest/Contents/MacOS/${{ env.PACKAGE_NAME }}PackageTests -instr-profile .build/debug/codecov/default.profdata > info.lcov
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true
fail_ci_if_error: true