Skip to content

Remove docker compose files + add GH action to compile examples during CI #397

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 30 commits into from
Oct 10, 2024
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
36bdd33
add docker fine grained permission to the plugin
sebsto Oct 8, 2024
7b28a79
swift-format
sebsto Oct 8, 2024
32b99bd
initial commit to fix docker compose
sebsto Oct 8, 2024
83ed705
update docker files
sebsto Oct 8, 2024
7d26fe7
add GH action to compile examples on PR
sebsto Oct 8, 2024
6cebe1a
Merge branch 'main' into sebsto/docker
sebsto Oct 8, 2024
686337a
make script executable
sebsto Oct 8, 2024
34ffd09
disable integration tests on Swift < 6.0
sebsto Oct 8, 2024
17dcfcc
Merge branch 'main' into sebsto/docker
sebsto Oct 8, 2024
355cd16
Merge branch 'main' into sebsto/docker
sebsto Oct 9, 2024
cffbfad
remove old docker infrastructure
sebsto Oct 9, 2024
ed39d47
automate the discovery of examples
sebsto Oct 9, 2024
f37846d
v2 API Proposal Document (#339)
aryan-25 Oct 9, 2024
6540328
Merge branch 'main' into sebsto/docker
sebsto Oct 9, 2024
b30dfe4
fix variable name for matrix action
sebsto Oct 9, 2024
ba36907
first test to get a matrix setup
sebsto Oct 9, 2024
876b237
refine matrix
sebsto Oct 9, 2024
534502b
refine matrix
sebsto Oct 9, 2024
dd21f48
fix reference to sub workflow
sebsto Oct 9, 2024
cce5208
remove references from docker
sebsto Oct 9, 2024
64337df
test passing an array
sebsto Oct 9, 2024
7df6a04
try to pass an array
sebsto Oct 9, 2024
26c6e31
test passing array
sebsto Oct 9, 2024
6156e93
revert back to hard coded example list in the matrix
sebsto Oct 9, 2024
c8ba600
add the example name in the job name
sebsto Oct 9, 2024
dd84d7c
improve naming
sebsto Oct 9, 2024
639224f
Use only one Swift version to build the examples
sebsto Oct 9, 2024
9c89ff2
fix image name
sebsto Oct 9, 2024
0f5ce60
use latest alias to fetch the latest version
sebsto Oct 9, 2024
8df40d8
Merge branch 'main' into sebsto/docker
sebsto Oct 9, 2024
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
11 changes: 11 additions & 0 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,17 @@ jobs:
linux_nightly_6_0_arguments_override: "--explicit-target-dependency-import-check error"
linux_nightly_main_arguments_override: "--explicit-target-dependency-import-check error"

integration-tests:
name: Integration Tests
# Workaround https://github.com/nektos/act/issues/1875
uses: apple/swift-nio/.github/workflows/swift_matrix.yml@main
with:
name: "Integration tests"
matrix_linux_command: "./scripts/integration_tests.sh"
linux_5_8_enabled: false
linux_5_9_enabled: false
linux_5_10_enabled: false

swift-6-language-mode:
name: Swift 6 Language Mode
uses: apple/swift-nio/.github/workflows/swift_6_language_mode.yml@main
9 changes: 1 addition & 8 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG swift_version=5.7
ARG swift_version=6.0
ARG base_image=swift:$swift_version-amazonlinux2
FROM $base_image
# needed to do again after FROM due to docker limitation
Expand All @@ -11,10 +11,3 @@ RUN yum install -y lsof dnsutils netcat-openbsd net-tools curl jq # used by inte
# tools
RUN mkdir -p $HOME/.tools
RUN echo 'export PATH="$HOME/.tools:$PATH"' >> $HOME/.profile

# swiftformat (until part of the toolchain)

ARG swiftformat_version=0.50.1
RUN git clone --branch $swiftformat_version --depth 1 https://github.com/nicklockwood/SwiftFormat $HOME/.tools/swift-format
RUN cd $HOME/.tools/swift-format && swift build -c release
RUN ln -s $HOME/.tools/swift-format/.build/release/swiftformat $HOME/.tools/swiftformat
18 changes: 0 additions & 18 deletions docker/docker-compose.al2.510.yaml

This file was deleted.

18 changes: 0 additions & 18 deletions docker/docker-compose.al2.57.yaml

This file was deleted.

18 changes: 0 additions & 18 deletions docker/docker-compose.al2.58.yaml

This file was deleted.

18 changes: 0 additions & 18 deletions docker/docker-compose.al2.59.yaml

This file was deleted.

18 changes: 18 additions & 0 deletions docker/docker-compose.al2.6.0.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
version: "3"

services:

runtime-setup:
image: swift-aws-lambda:al2-6.0
build:
args:
base_image: "swiftlang/swift:nightly-6.0-amazonlinux2"

test:
image: swift-aws-lambda:al2-6.0

test-examples:
image: swift-aws-lambda:al2-6.0

shell:
image: swift-aws-lambda:al2-6.0
21 changes: 10 additions & 11 deletions docker/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# this file is not designed to be run directly
# instead, use the docker-compose.<os>.<swift> files
# eg docker-compose -f docker/docker-compose.yaml -f docker/docker-compose.al2.57.yaml run test
version: "3"
# eg docker-compose -f docker/docker-compose.yaml -f docker/docker-compose.al2.6.0.yaml run test

services:

Expand All @@ -24,7 +23,11 @@ services:

soundness:
<<: *common
command: /bin/bash -cl "./scripts/soundness.sh"
command: >-
/bin/bash -clx "
curl -s https://raw.githubusercontent.com/apple/swift-nio/main/scripts/check-swift-format.sh | bash &&
curl -s https://raw.githubusercontent.com/apple/swift-nio/main/scripts/check-license-header.sh | bash
"

test:
<<: *common
Expand All @@ -34,14 +37,10 @@ services:
<<: *common
command: >-
/bin/bash -clx "
LAMBDA_USE_LOCAL_DEPS=true swift build --package-path Examples/Benchmark &&
LAMBDA_USE_LOCAL_DEPS=true swift build --package-path Examples/Deployment &&
LAMBDA_USE_LOCAL_DEPS=true swift build --package-path Examples/Echo &&
LAMBDA_USE_LOCAL_DEPS=true swift build --package-path Examples/ErrorHandling &&
LAMBDA_USE_LOCAL_DEPS=true swift build --package-path Examples/Foundation &&
LAMBDA_USE_LOCAL_DEPS=true swift build --package-path Examples/JSON &&
LAMBDA_USE_LOCAL_DEPS=true swift build --package-path Examples/LocalDebugging/MyLambda &&
LAMBDA_USE_LOCAL_DEPS=true swift test --package-path Examples/Testing
LAMBDA_USE_LOCAL_DEPS=true swift build --package-path Examples/APIGateway &&
LAMBDA_USE_LOCAL_DEPS=true swift build --package-path Examples/AWSSDK &&
LAMBDA_USE_LOCAL_DEPS=true swift build --package-path Examples/HelloWorld &&
LAMBDA_USE_LOCAL_DEPS=true swift build --package-path Examples/Soto
"

# util
Expand Down
8 changes: 8 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,3 +163,11 @@ tbd + link to docc
### Background Tasks

tbd + link to docc

### Development

Your contributions are welcome. If you open a pull request, be sure to ensure it passes the soundness checks

```
docker-compose -f docker/docker-compose.yaml -f docker/docker-compose.al2.6.0.yaml run soundness
```
21 changes: 21 additions & 0 deletions scripts/integration_tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash
##===----------------------------------------------------------------------===##
##
## This source file is part of the SwiftAWSLambdaRuntime open source project
##
## Copyright (c) 2017-2018 Apple Inc. and the SwiftAWSLambdaRuntime project authors
## Licensed under Apache License v2.0
##
## See LICENSE.txt for license information
## See CONTRIBUTORS.txt for the list of SwiftAWSLambdaRuntime project authors
##
## SPDX-License-Identifier: Apache-2.0
##
##===----------------------------------------------------------------------===##

set +ex

LAMBDA_USE_LOCAL_DEPS=true swift build --package-path Examples/APIGateway
LAMBDA_USE_LOCAL_DEPS=true swift build --package-path Examples/AWSSDK
LAMBDA_USE_LOCAL_DEPS=true swift build --package-path Examples/HelloWorld
LAMBDA_USE_LOCAL_DEPS=true swift build --package-path Examples/Soto