Skip to content

Commit

Permalink
Use Run target
Browse files Browse the repository at this point in the history
  • Loading branch information
siemensikkema committed Sep 13, 2021
1 parent d1fdf76 commit 2cf1e7b
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Test
run: swift test --sanitize=thread --enable-code-coverage
- name: Generate code coverage report
run: llvm-cov export -format=lcov --instr-profile=.build/debug/codecov/default.profdata .build/debug/sonar-test > coverage.report
run: llvm-cov export -format=lcov --instr-profile=.build/debug/codecov/default.profdata .build/debug/Run > coverage.report
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
env:
Expand Down
11 changes: 5 additions & 6 deletions Package.swift
Expand Up @@ -5,17 +5,16 @@ import PackageDescription

let package = Package(
name: "sonar-test",
products: [
// Products define the executables and libraries a package produces, and make them visible to other packages.
.library(
name: "sonar-test",
targets: ["sonar-test"]),
],
dependencies: [
// Dependencies declare other packages that this package depends on.
// .package(url: /* package url */, from: "1.0.0"),
],
targets: [
.executableTarget(
name: "Run",
dependencies: [
"sonar-test",
]),
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
// Targets can depend on other targets in this package, and on products in packages this package depends on.
.target(
Expand Down
3 changes: 3 additions & 0 deletions Sources/Run/main.swift
@@ -0,0 +1,3 @@
import sonar_test

print(sonar_test().text)
4 changes: 3 additions & 1 deletion sonar-project.properties
Expand Up @@ -9,4 +9,6 @@ sonar.organization=siemensikkema
#sonar.sources=.

# Encoding of the source code. Default is default system encoding
#sonar.sourceEncoding=UTF-8
#sonar.sourceEncoding=UTF-8

sonar.swift.coverage.reportPaths=coverage.report

0 comments on commit 2cf1e7b

Please sign in to comment.