Skip to content

[Rework]: Add swift 5.8 and new features #43

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 17 commits into from
Jun 9, 2023
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: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM swift:5.5.3-bionic AS builder
FROM swift:5.8-bionic AS builder
# WORKDIR /opt/testrunner
COPY src/testrunner ./

Expand All @@ -7,7 +7,8 @@ RUN swift --version
#RUN swift package clean
RUN swift build --configuration release

FROM swift:5.5.3-bionic
FROM swift:5.8-bionic
RUN apt-get update && apt-get install -y jq
WORKDIR /opt/test-runner/
COPY bin/ bin/
COPY --from=builder /.build/release/TestRunner bin/
Expand Down
10 changes: 9 additions & 1 deletion bin/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@ fi
SLUG="$1"
INPUT_DIR="${2%/}"
OUTPUT_DIR="${3%/}"
junit_file="${INPUT_DIR}/results.xml"
capture_file="${OUTPUT_DIR}/capture"
spec_file="${INPUT_DIR}/$(jq -r '.files.test[0]' ${INPUT_DIR}/.meta/config.json)"
results_file="${OUTPUT_DIR}/results.json"
BASEDIR=$(dirname "$0")

RUNALL=true "${BASEDIR}"/TestRunner --slug "${SLUG}" --solution-directory "${INPUT_DIR}" --output-directory "${OUTPUT_DIR}" --swift-location $(which swift) --build-directory "/tmp"
touch "${results_file}"

swift test --package-path "${INPUT_DIR}" -v --parallel --xunit-output "${junit_file}" &> "${capture_file}"

./bin/TestRunner "${spec_file}" "${junit_file}" "${capture_file}" "${results_file}"
14 changes: 6 additions & 8 deletions src/testrunner/Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version:5.2
// swift-tools-version:5.8
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription
Expand All @@ -8,16 +8,14 @@ let package = Package(
dependencies: [
// Dependencies declare other packages that this package depends on.
// .package(url: /* package url */, from: "1.0.0"),
.package(url: "https://github.com/apple/swift-argument-parser", from: "0.0.1")
.package(url: "https://github.com/apple/swift-syntax.git", exact: "508.0.1")
],
targets: [
// 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 which this package depends on.
.target(
name: "TestRunner",
dependencies: [.product(name: "ArgumentParser", package: "swift-argument-parser"),]),
.testTarget(
name: "TestRunnerTests",
dependencies: ["TestRunner"]),
.target(name: "TestRunner", dependencies: [
.product(name: "SwiftSyntax", package: "swift-syntax"),
.product(name: "SwiftParser", package: "swift-syntax"),
]),
]
)
Loading