diff --git a/.github/workflows/beta-release.yaml b/.github/workflows/beta-release.yaml index 504d5af..ad54579 100644 --- a/.github/workflows/beta-release.yaml +++ b/.github/workflows/beta-release.yaml @@ -4,7 +4,7 @@ on: tags: - "v*.*.*-beta" jobs: - test: + beta-release: runs-on: macos-latest steps: - name: Checkout diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 4889fe4..0d11f7e 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -4,7 +4,7 @@ on: tags: - "v[0-9]+.[0-9]+.[0-9]+" jobs: - test: + release: runs-on: macos-latest steps: - name: Checkout diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 5cce489..e5118a1 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -2,15 +2,35 @@ name: Run tests on: [push] jobs: test: - runs-on: macos-latest + runs-on: macos-11 steps: - name: Checkout uses: actions/checkout@v2 - name: Resolve Dependency run: swift package update + - name: Generate Xcode Project + run: swift package generate-xcodeproj - name: Test - run: swift test --enable-code-coverage - - name: Covert Code Coverage - run: xcrun llvm-cov export -format=lcov .build/debug/TypedNotificationPackageTests.xctest/Contents/MacOS/TypedNotificationPackageTests -instr-profile=.build/debug/codecov/default.profdata > lcov.info + uses: sersoft-gmbh/xcodebuild-action@v1 + with: + project: ./TypedNotification.xcodeproj + scheme: TypedNotification-Package + derived-data-path: ./output + destination: "OS=15.0,name=iPhone 13 Mini" + result-bundle-path: coverage/result.xcresult + action: clean build test + enable-code-coverage: true + build-settings: ENABLE_TESTING_SEARCH_PATHS=YES CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO + - name: Archive Artifacts + uses: actions/upload-artifact@v2 + with: + path: ./output + - name: Convert Coverage Report to JSON + run: xcrun xccov view --report --json coverage/result.xcresult > cov.json + - name: Convert JSON Coverage Report to LCOV + run: swift run xccov2lcov cov.json > coverage.lcov - name: Upload Codecov uses: codecov/codecov-action@v2 + with: + directory: ./output/Build + verbose: true diff --git a/.gitignore b/.gitignore index 2f193c8..0102e7a 100644 --- a/.gitignore +++ b/.gitignore @@ -16,6 +16,7 @@ DerivedData/ *.perspectivev3 !default.perspectivev3 xcuserdata/ +output/ ## Other *.moved-aside @@ -39,8 +40,10 @@ Packages/ Package.pins Package.resolved .build/ +.output/ .swiftpm /build +TypedNotification.xcodeproj # CocoaPods # diff --git a/README.md b/README.md index 792d241..e275662 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,7 @@ [![Swift Package Manager](https://img.shields.io/badge/SwiftPM-Compatiable-brightgreen.svg)](https://swift.org/package-manager/) [![release](https://img.shields.io/github/release/dbi1463/typed-notification/all.svg)](https://github.com/dbi1463/typed-notification/releases) [![MIT license](https://img.shields.io/badge/License-MIT-blue.svg)](https://lbesson.mit-license.org/) +[![codecov](https://codecov.io/gh/dbi1463/typed-notification/branch/develop/graph/badge.svg?token=5hEk4BfOif)](https://codecov.io/gh/dbi1463/typed-notification) A type-safe way to receive notifications.