Skip to content

Add coverage to codecov.io #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Mar 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/workflows/meterian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@

name: Meterian Scanner workflow

on: push
on:
push:
branches:
- main

jobs:
meterian_scan:
Expand Down
18 changes: 11 additions & 7 deletions .github/workflows/swift-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ jobs:
swift-tests:
name: 'Swift Tests'
runs-on: ubuntu-latest
container: swift:5.10-jammy

# Use the Bash shell regardless whether the GitHub Actions runner is ubuntu-latest, macos-latest, or windows-latest
defaults:
run:
Expand All @@ -23,12 +21,18 @@ jobs:
- name: Checkout
uses: actions/checkout@v3

# Run tests with Thread Sanitizer https://www.swift.org/blog/tsan-support-on-linux/
- name: Run tests with Thread Sanitizer
run: swift test
# Set up Swift
- uses: swift-actions/setup-swift@v2
with:
swift-version: "5.10"
- name: Get swift version
run: swift --version

# Run tests
- name: Run tests
run: make test
- name: Coverage
run: |
make coverage
run: make coverage
- name: Upload Code Coverage
uses: codecov/codecov-action@v3
with:
Expand Down
16 changes: 15 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,21 @@
SWIFT_DOCKER_IMAGE = swift:5.10-jammy
MOUNT_ROOT=$(shell pwd)
SWIFT_BIN_PATH = $(shell swift build --show-bin-path)
TEST_PACKAGE= $(SWIFT_BIN_PATH)/SLSAdapterTestsPackageTests.xctest
TEST_PACKAGE= $(SWIFT_BIN_PATH)/swift-sls-adapterPackageTests.xctest
BUILD_TEMP = .build/temp

docker_bash:
docker run \
-it \
--rm \
--volume "$(MOUNT_ROOT):/src" \
--workdir "/src/" \
$(SWIFT_DOCKER_IMAGE) \
/bin/bash

test:
swift test --enable-code-coverage

coverage:
llvm-cov export $(TEST_PACKAGE) \
--instr-profile=$(SWIFT_BIN_PATH)/codecov/default.profdata \
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# swift-sls-adapter
[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Fswift-serverless%2Fswift-sls-adapter%2Fbadge%3Ftype%3Dswift-versions)](https://swiftpackageindex.com/swift-serverless/swift-sls-adapter) [![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Fswift-serverless%2Fswift-sls-adapter%2Fbadge%3Ftype%3Dplatforms)](https://swiftpackageindex.com/swift-serverless/swift-sls-adapter) [![Swift test](https://github.com/swift-serverless/swift-sls-adapter/actions/workflows/swift-test.yml/badge.svg)](https://github.com/swift-serverless/swift-sls-adapter/actions/workflows/swift-test.yml) [![security status](https://www.meterian.io/badge/gh/swift-serverless/swift-sls-adapter/security?branch=main)](https://www.meterian.io/report/gh/swift-serverless/swift-sls-adapter)
[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Fswift-serverless%2Fswift-sls-adapter%2Fbadge%3Ftype%3Dswift-versions)](https://swiftpackageindex.com/swift-serverless/swift-sls-adapter) [![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Fswift-serverless%2Fswift-sls-adapter%2Fbadge%3Ftype%3Dplatforms)](https://swiftpackageindex.com/swift-serverless/swift-sls-adapter) [![Swift test](https://github.com/swift-serverless/swift-sls-adapter/actions/workflows/swift-test.yml/badge.svg)](https://github.com/swift-serverless/swift-sls-adapter/actions/workflows/swift-test.yml) [![codecov](https://codecov.io/gh/swift-serverless/swift-sls-adapter/branch/main/graph/badge.svg?token=PJR7YGBSQ0)](https://codecov.io/gh/swift-serverless/swift-sls-adapter) [![security status](https://www.meterian.io/badge/gh/swift-serverless/swift-sls-adapter/security?branch=main)](https://www.meterian.io/report/gh/swift-serverless/swift-sls-adapter)
[![stability status](https://www.meterian.io/badge/gh/swift-serverless/swift-sls-adapter/stability?branch=main)](https://www.meterian.io/report/gh/swift-serverless/swift-sls-adapter)
[![licensing status](https://www.meterian.io/badge/gh/swift-serverless/swift-sls-adapter/licensing?branch=main)](https://www.meterian.io/report/gh/swift-serverless/swift-sls-adapter)

Expand Down
Loading