Skip to content

Commit

Permalink
[ci] #continuous-resilience
Browse files Browse the repository at this point in the history
  • Loading branch information
mxcl committed May 29, 2021
1 parent 0a54e7f commit bd16bc4
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 27 deletions.
56 changes: 36 additions & 20 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,37 +5,53 @@ on:
- Sources/**
- Tests/**
- .github/workflows/ci.yml
schedule:
- cron: '3 3 * * 4' # 3:03 AM, every Thursday
jobs:
auto-cancel:
runs-on: ubuntu-latest
steps:
- uses: technote-space/auto-cancel-redundant-job@v1
macOS:
needs: auto-cancel
runs-on: macos-latest
steps:
- uses: technote-space/auto-cancel-redundant-job@v1
- uses: actions/checkout@v2
- run: swift package generate-xcodeproj --enable-code-coverage
- uses: sersoft-gmbh/xcodebuild-action@v1
with:
project: Version.xcodeproj
scheme: Version-Package
action: test
- uses: codecov/codecov-action@v1
- run: swift test

linux:
needs: auto-cancel
runs-on: ubuntu-18.04
runs-on: ubuntu-latest
strategy:
matrix:
swift:
- '4.2'
- '5.0'
- '5.1'
- '5.2'
- '5.3'
- '5.4'
- '4.2'
- '5.0'
- '5.1'
- '5.2'
- '5.3'
container:
image: swift:${{ matrix.swift }}
steps:
- uses: actions/checkout@v2
- run: swift build

code-coverage:
runs-on: ubuntu-latest
name: linux (5.4)
container:
image: swift:5.4
continue-on-error: true #continuous-resilience
steps:
- uses: actions/checkout@v2
- run: swift test --enable-code-coverage
- run: |
apt-get -qq update
apt-get -qq install curl
# ^^ for codecov’s action 🙄
- run: |
b="$(swift build --show-bin-path)"
llvm-cov export \
-format lcov \
-instr-profile="$b/codecov/default.profdata" \
--ignore-filename-regex='\.build|Tests' \
"$b"/*.xctest \
> info.lcov
- uses: codecov/codecov-action@v1
with:
file: ./info.lcov
7 changes: 0 additions & 7 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,3 @@ let pkg = Package(
],
swiftLanguageVersions: [.v4, .v4_2, .version("5")]
)

#if !os(Linux)
// testing on Linux not necessary since we have no platform specific code
// thus if there are any issues, they are Swift bugs
// would support it if Linux testing wasn‘t a PITA
pkg.targets.append(.testTarget(name: "Tests.Version.mxcl", dependencies: ["Version"], path: "Tests"))
#endif
17 changes: 17 additions & 0 deletions [email protected]
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// swift-tools-version:5.3
import PackageDescription

let pkg = Package(
name: "Version",
products: [
.library(name: "Version", targets: ["Version"]),
],
targets: [
.target(name: "Version", path: "Sources"),
],
swiftLanguageVersions: [.v4, .v4_2, .v5]
)

#if swift(>=5.4) || os(macOS)
pkg.targets.append(.testTarget(name: "Tests.Version.mxcl", dependencies: ["Version"], path: "Tests"))
#endif

0 comments on commit bd16bc4

Please sign in to comment.