-
Notifications
You must be signed in to change notification settings - Fork 108
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
Remove docker compose files + add GH action to compile examples during CI #397
Merged
Merged
Changes from all 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 7b28a79
swift-format
sebsto 32b99bd
initial commit to fix docker compose
sebsto 83ed705
update docker files
sebsto 7d26fe7
add GH action to compile examples on PR
sebsto 6cebe1a
Merge branch 'main' into sebsto/docker
sebsto 686337a
make script executable
sebsto 34ffd09
disable integration tests on Swift < 6.0
sebsto 17dcfcc
Merge branch 'main' into sebsto/docker
sebsto 355cd16
Merge branch 'main' into sebsto/docker
sebsto cffbfad
remove old docker infrastructure
sebsto ed39d47
automate the discovery of examples
sebsto f37846d
v2 API Proposal Document (#339)
aryan-25 6540328
Merge branch 'main' into sebsto/docker
sebsto b30dfe4
fix variable name for matrix action
sebsto ba36907
first test to get a matrix setup
sebsto 876b237
refine matrix
sebsto 534502b
refine matrix
sebsto dd21f48
fix reference to sub workflow
sebsto cce5208
remove references from docker
sebsto 64337df
test passing an array
sebsto 7df6a04
try to pass an array
sebsto 26c6e31
test passing array
sebsto 6156e93
revert back to hard coded example list in the matrix
sebsto c8ba600
add the example name in the job name
sebsto dd84d7c
improve naming
sebsto 639224f
Use only one Swift version to build the examples
sebsto 9c89ff2
fix image name
sebsto 0f5ce60
use latest alias to fetch the latest version
sebsto 8df40d8
Merge branch 'main' into sebsto/docker
sebsto File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
name: ExamplesMatrix | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
name: | ||
type: string | ||
description: "The name of the workflow used for the concurrency group." | ||
required: true | ||
# examples: | ||
# type: sequence | ||
# description: "The examples to run." | ||
# required: true | ||
matrix_linux_command: | ||
type: string | ||
description: "The command of the current Swift version linux matrix job to execute." | ||
required: true | ||
matrix_linux_swift_container_image: | ||
type: string | ||
description: "Container image for the matrix job. Defaults to matching latest Swift Ubuntu image." | ||
default: "swift:latest" | ||
|
||
## We are cancelling previously triggered workflow runs | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }}-${{ inputs.name }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
linux: | ||
name: Example/${{ matrix.examples }} on Linux ${{ matrix.swift.swift_version }} | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
# This should be passed as an argument in input. Can we pass arrays as argument ? | ||
examples : [ "HelloWorld", "APIGateway" ] | ||
# examples: ${{ inputs.examples }} | ||
|
||
# We are using only one Swift version | ||
swift: | ||
sebsto marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- image: ${{ inputs.matrix_linux_swift_container_image }} | ||
swift_version: "6.0.1-noble" | ||
container: | ||
image: ${{ matrix.swift.image }} | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
persist-credentials: false | ||
- name: Mark the workspace as safe | ||
# https://github.com/actions/checkout/issues/766 | ||
run: git config --global --add safe.directory ${GITHUB_WORKSPACE} | ||
- name: Run matrix job | ||
env: | ||
SWIFT_VERSION: ${{ matrix.swift.swift_version }} | ||
COMMAND: ${{ inputs.matrix_linux_command }} | ||
EXAMPLE: ${{ matrix.examples }} | ||
run: | | ||
apt-get -qq update && apt-get -qq -y install curl | ||
./scripts/integration_tests.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/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 -euo pipefail | ||
|
||
log() { printf -- "** %s\n" "$*" >&2; } | ||
error() { printf -- "** ERROR: %s\n" "$*" >&2; } | ||
fatal() { error "$@"; exit 1; } | ||
|
||
test -n "${SWIFT_VERSION:-}" || fatal "SWIFT_VERSION unset" | ||
test -n "${COMMAND:-}" || fatal "COMMAND unset" | ||
test -n "${EXAMPLE:-}" || fatal "EXAMPLE unset" | ||
swift_version="$SWIFT_VERSION" | ||
command="$COMMAND" | ||
example="$EXAMPLE" | ||
|
||
pushd Examples/"$example" > /dev/null | ||
|
||
log "Running command with Swift $SWIFT_VERSION" | ||
eval "$command" | ||
|
||
popd |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure we need an extra workflow for this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fabianfett This is a matter of separation of concerns. Just like when we create 2 .swift files for two different struct.
In the reporting web view, it doesn't matter if this is a sub workflow or not.
I really don't want to bring this complexity in
pull_request.yml
. Where would you host this script if not in a separate workflow ?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.