Skip to content
Open
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
12 changes: 9 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,12 @@ jobs:
runs-on: ubuntu-latest
container:
image: swift:6.3.1
env:
DOCKER_BUILDKIT: 1
COMPOSE_DOCKER_CLI_BUILD: 1
steps:
- name: Install dependencies
run: apt-get update && apt-get install -y curl unzip
run: apt-get update && apt-get install -y curl unzip docker.io docker-buildx
- uses: actions/checkout@v6
- name: Build
run: swift build -c release -Xswiftc -strict-concurrency=complete
Expand Down Expand Up @@ -48,9 +51,12 @@ jobs:
runs-on: ubuntu-latest
container:
image: swift:6.3.1
env:
DOCKER_BUILDKIT: 1
COMPOSE_DOCKER_CLI_BUILD: 1
steps:
- name: Install dependencies
run: apt-get update && apt-get install -y curl
- name: Install dependencies
run: apt-get update && apt-get install -y curl docker.io docker-buildx
- uses: actions/checkout@v6
- name: Run tests with coverage
run: swift test --enable-code-coverage --xunit-output test-results.xml
Expand Down
8 changes: 8 additions & 0 deletions .local-containers/codegen.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"templates": [
{
"source": "Resources/dynamodb-table.json",
"structName": "DynamodbTableOutputs"
}
]
}
1 change: 1 addition & 0 deletions .local-containers/env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
LOCALSTACK_AUTH_TOKEN=ls-VEMI8629-giJu-kakU-4934-vUcAqeSU5f04
13 changes: 10 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,23 @@
# syntax=docker/dockerfile:1

FROM swift:6.3.1-noble AS toolchain
FROM --platform=$BUILDPLATFORM swift:6.3.1-noble AS toolchain
RUN swift sdk install \
https://download.swift.org/swift-6.3.1-release/static-sdk/swift-6.3.1-RELEASE/swift-6.3.1-RELEASE_static-linux-0.1.0.artifactbundle.tar.gz \
--checksum fac05271c1f7d060bd203240ce5251d5ca902d30ac899f553765dbb3a88b97ad

FROM toolchain AS build
ARG TARGETARCH
WORKDIR /workspace
COPY . .
RUN --mount=type=cache,target=/workspace/.build \
swift build -c release --swift-sdk aarch64-swift-linux-musl && \
cp .build/aarch64-swift-linux-musl/release/TaskCluster /TaskCluster
set -eux; \
case "$TARGETARCH" in \
amd64) SDK_TARGET=x86_64-swift-linux-musl ;; \
arm64) SDK_TARGET=aarch64-swift-linux-musl ;; \
*) echo "Unsupported TARGETARCH: $TARGETARCH" >&2; exit 1 ;; \
esac; \
swift build -c release --swift-sdk "$SDK_TARGET"; \
cp ".build/$SDK_TARGET/release/TaskCluster" /TaskCluster

FROM scratch AS runtime
COPY --from=build /TaskCluster /TaskCluster
Expand Down
122 changes: 97 additions & 25 deletions Package.resolved

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

33 changes: 32 additions & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,22 @@ let package = Package(
.macOS(.v15)
],
dependencies: [
.package(url: "https://github.com/swift-server-community/dynamo-db-tables", from: "1.0.0-rc.2"),
.package(
url: "https://github.com/swift-server-community/dynamo-db-tables",
from: "1.0.0-rc.2",
traits: ["SOTOSDK"]
),
.package(url: "https://github.com/apple/swift-openapi-generator", from: "1.6.0"),
.package(url: "https://github.com/apple/swift-openapi-runtime", from: "1.7.0"),
.package(url: "https://github.com/swift-server/swift-openapi-hummingbird", from: "2.0.1"),
.package(url: "https://github.com/swift-server/swift-openapi-async-http-client", from: "1.1.0"),
.package(url: "https://github.com/hummingbird-project/hummingbird", from: "2.0.0"),
.package(url: "https://github.com/tachyonics/smockable", from: "1.0.0-rc.3"),
.package(url: "https://github.com/apple/swift-configuration", from: "1.1.0"),
.package(url: "https://github.com/tachyonics/swift-local-containers", branch: "main"),
.package(url: "https://github.com/swift-server/async-http-client", from: "1.24.0"),
.package(url: "https://github.com/soto-project/soto", from: "7.0.0"),
.package(url: "https://github.com/soto-project/soto-core", from: "7.0.0"),
],
targets: [
.target(
Expand Down Expand Up @@ -53,8 +62,11 @@ let package = Package(
"TaskClusterApp",
"TaskClusterDynamoDBModel",
.product(name: "DynamoDBTables", package: "dynamo-db-tables"),
.product(name: "DynamoDBTablesSoto", package: "dynamo-db-tables"),
.product(name: "Configuration", package: "swift-configuration"),
.product(name: "Hummingbird", package: "hummingbird"),
.product(name: "SotoCore", package: "soto-core"),
.product(name: "SotoDynamoDB", package: "soto"),
]
),
.testTarget(
Expand All @@ -75,5 +87,24 @@ let package = Package(
.product(name: "DynamoDBTables", package: "dynamo-db-tables"),
]
),
.testTarget(
name: "TaskClusterIntegrationTests",
dependencies: [
"TaskAPI",
"TaskClusterModel",
.product(name: "ContainerMacrosLib", package: "swift-local-containers"),
.product(name: "ContainerTestSupport", package: "swift-local-containers"),
.product(name: "AsyncHTTPClient", package: "async-http-client"),
.product(name: "OpenAPIRuntime", package: "swift-openapi-runtime"),
.product(name: "OpenAPIAsyncHTTPClient", package: "swift-openapi-async-http-client"),
.product(name: "DynamoDBTables", package: "dynamo-db-tables"),
.product(name: "DynamoDBTablesSoto", package: "dynamo-db-tables"),
.product(name: "SotoCore", package: "soto-core"),
.product(name: "SotoDynamoDB", package: "soto"),
],
plugins: [
.plugin(name: "ContainerCodeGen", package: "swift-local-containers")
]
),
]
)
1 change: 1 addition & 0 deletions Sources/TaskAPI/openapi-generator-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
generate:
- types
- server
- client
accessModifier: package
filter:
tags:
Expand Down
Loading
Loading