feat: Adds Docker tests.
This commit is contained in:
2
.dockerignore
Normal file
2
.dockerignore
Normal file
@@ -0,0 +1,2 @@
|
||||
.build
|
||||
.env
|
||||
28
Dockerfile
Normal file
28
Dockerfile
Normal file
@@ -0,0 +1,28 @@
|
||||
ARG SWIFT_IMAGE="swift:6.0-noble"
|
||||
|
||||
FROM ${SWIFT_IMAGE}
|
||||
|
||||
# Install OS updates
|
||||
RUN export DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true \
|
||||
&& apt-get -q update \
|
||||
&& apt-get -q dist-upgrade -y
|
||||
|
||||
# Set up a build area
|
||||
WORKDIR /build
|
||||
|
||||
# First just resolve dependencies.
|
||||
# This creates a cached layer that can be reused
|
||||
# as long as your Package.swift/Package.resolved
|
||||
# files do not change.
|
||||
COPY ./Package.* ./
|
||||
RUN --mount=type=cache,target=/build/.build swift package resolve \
|
||||
$([ -f ./Package.resolved ] && echo "--force-resolved-versions" || true)
|
||||
|
||||
# Copy entire repo into container
|
||||
COPY . .
|
||||
|
||||
# Build the application, with optimizations, with static linking, and using jemalloc
|
||||
# N.B.: The static version of jemalloc is incompatible with the static Swift runtime.
|
||||
RUN swift build
|
||||
|
||||
CMD ["swift", "test"]
|
||||
@@ -1,4 +1,4 @@
|
||||
// swift-tools-version: 6.1
|
||||
// swift-tools-version: 6.0
|
||||
// The swift-tools-version declares the minimum version of Swift required to build this package.
|
||||
|
||||
import PackageDescription
|
||||
|
||||
@@ -223,7 +223,7 @@ private extension CoolingInterpolation.OneWayOutdoor {
|
||||
private func interpolate(
|
||||
outdoorDesignTemperature: Int,
|
||||
aboveCapacity: KeyPath<CoolingInterpolation.OneWayOutdoor.Capacities.Capacity, Int>,
|
||||
belowCapacity: KeyPath<CoolingInterpolation.OneWayOutdoor.Capacities.Capacity, Int>,
|
||||
belowCapacity: KeyPath<CoolingInterpolation.OneWayOutdoor.Capacities.Capacity, Int>
|
||||
) async -> Int {
|
||||
return await interpolateOutdoorCapacity(
|
||||
outdoorDesignTemperature: outdoorDesignTemperature,
|
||||
|
||||
@@ -209,7 +209,7 @@ struct ManualSTests {
|
||||
@Dependency(\.manualS) var manualS
|
||||
|
||||
let limits = try await manualS.sizingLimits(.init(
|
||||
systemType: .heatingOnly(type: heatingType),
|
||||
systemType: .heatingOnly(type: heatingType)
|
||||
))
|
||||
|
||||
#expect(limits.oversizing.heating == heatingType.oversizingLimit)
|
||||
|
||||
Reference in New Issue
Block a user