Skip to content

Commit e1f390a

Browse files
ci: Migrate to GitHub Actions and reusable workflows, part one (#116)
### Motivation Following on from the migration in Swift OpenAPI Generator, we need to migrate this repo to GitHub Actions based CI and the reusable workflows that are currently in the NIO repo. ### Modifications In order to bootstrap the migration, we need to merge the workflows in, otherwise we won't get any PR feedback on them while we get them ready. As a practical matter, they are all passing locally (verified) by `act` but it would be nice to stage these in so we can keep a green CI while we migrate and decommission the old CI. So this disables the soundness checks for now, so we can then use a follow up PR to do the cut over with testing in the PR. ### Result Old CI still working, new CI should start running in some capacity.
1 parent f95974c commit e1f390a

13 files changed

+101
-12
lines changed

.github/workflows/pull_request.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: PR
2+
3+
on:
4+
pull_request:
5+
types: [opened, reopened, synchronize]
6+
7+
jobs:
8+
soundness:
9+
name: Soundness
10+
uses: apple/swift-nio/.github/workflows/soundness.yml@main
11+
with:
12+
# These are set to false to stage this in with the old CI.
13+
# A follow-up PR will cut them over.
14+
api_breakage_check_enabled: false
15+
broken_symlink_check_enabled: false
16+
docs_check_enabled: false
17+
format_check_enabled: false
18+
license_header_check_enabled: false
19+
license_header_check_project_name: "SwiftOpenAPIGenerator"
20+
shell_check_enabled: false
21+
unacceptable_language_check_enabled: false
22+
23+
unit-tests:
24+
name: Unit tests
25+
uses: apple/swift-nio/.github/workflows/unit_tests.yml@main
26+
with:
27+
linux_5_8_enabled: false
28+
linux_5_9_arguments_override: "--explicit-target-dependency-import-check error"
29+
linux_5_10_arguments_override: "--explicit-target-dependency-import-check error"
30+
linux_nightly_6_0_arguments_override: "--explicit-target-dependency-import-check error"
31+
linux_nightly_main_enabled: false
32+
33+
integration-test:
34+
name: Integration test
35+
uses: apple/swift-nio/.github/workflows/swift_matrix.yml@main
36+
with:
37+
name: "Integration test"
38+
matrix_linux_command: "apt-get update -yq && apt-get install -yq jq && ./scripts/run-integration-test.sh"
39+
matrix_linux_5_8_enabled: false
40+
matrix_linux_nightly_main_enabled: false
41+
42+
swift-6-language-mode:
43+
name: Swift 6 Language Mode
44+
uses: apple/swift-nio/.github/workflows/swift_6_language_mode.yml@main
45+
if: false # Disabled for now.

.github/workflows/scheduled.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Scheduled
2+
3+
on:
4+
schedule:
5+
- cron: "0 8,20 * * *"
6+
7+
jobs:
8+
unit-tests:
9+
name: Unit tests
10+
uses: apple/swift-nio/.github/workflows/unit_tests.yml@main
11+
with:
12+
linux_5_8_enabled: false
13+
linux_5_9_arguments_override: "--explicit-target-dependency-import-check error"
14+
linux_5_10_arguments_override: "--explicit-target-dependency-import-check error"
15+
linux_nightly_6_0_arguments_override: "--explicit-target-dependency-import-check error"
16+
linux_nightly_main_arguments_override: "--explicit-target-dependency-import-check error"
17+
18+
integration-test:
19+
name: Integration test
20+
uses: apple/swift-nio/.github/workflows/swift_matrix.yml@main
21+
with:
22+
name: "Integration test"
23+
matrix_linux_command: "apt-get update -yq && apt-get install -yq jq && ./scripts/run-integration-test.sh"
24+
matrix_linux_5_8_enabled: false
25+
26+
example-packages:
27+
name: Example packages
28+
uses: apple/swift-nio/.github/workflows/swift_matrix.yml@main
29+
with:
30+
name: "Example packages"
31+
matrix_linux_command: "./scripts/test-examples.sh"
32+
matrix_linux_5_8_enabled: false

.licenseignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
.gitignore
2+
.licenseignore
3+
.swiftformatignore
4+
.spi.yml
5+
.swift-format
6+
.github/
7+
**.md
8+
**.txt
9+
Package.swift

.swiftformatignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Package.swift

scripts/check-for-breaking-api-changes.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env bash
1+
#!/bin/bash
22
##===----------------------------------------------------------------------===##
33
##
44
## This source file is part of the SwiftOpenAPIGenerator open source project

scripts/check-for-broken-symlinks.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env bash
1+
#!/bin/bash
22
##===----------------------------------------------------------------------===##
33
##
44
## This source file is part of the SwiftOpenAPIGenerator open source project

scripts/check-for-docc-warnings.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env bash
1+
#!/bin/bash
22
##===----------------------------------------------------------------------===##
33
##
44
## This source file is part of the SwiftOpenAPIGenerator open source project

scripts/check-for-unacceptable-language.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env bash
1+
#!/bin/bash
22
##===----------------------------------------------------------------------===##
33
##
44
## This source file is part of the SwiftOpenAPIGenerator open source project

scripts/check-license-headers.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env bash
1+
#!/bin/bash
22
##===----------------------------------------------------------------------===##
33
##
44
## This source file is part of the SwiftOpenAPIGenerator open source project
@@ -51,6 +51,8 @@ read -ra PATHS_TO_CHECK_FOR_LICENSE <<< "$( \
5151
":(exclude)Package.swift" \
5252
":(exclude)README.md" \
5353
":(exclude)SECURITY.md" \
54+
":(exclude).licenseignore" \
55+
":(exclude).swiftformatignore" \
5456
":(exclude)scripts/unacceptable-language.txt" \
5557
":(exclude)docker/*" \
5658
":(exclude)**/*.docc/*" \
@@ -64,7 +66,7 @@ for FILE_PATH in "${PATHS_TO_CHECK_FOR_LICENSE[@]}"; do
6466
case "${FILE_EXTENSION}" in
6567
swift) EXPECTED_FILE_HEADER=$(sed -e 's|@@|//|g' <<<"${EXPECTED_FILE_HEADER_TEMPLATE}") ;;
6668
yml) EXPECTED_FILE_HEADER=$(sed -e 's|@@|##|g' <<<"${EXPECTED_FILE_HEADER_TEMPLATE}") ;;
67-
sh) EXPECTED_FILE_HEADER=$(cat <(echo '#!/usr/bin/env bash') <(sed -e 's|@@|##|g' <<<"${EXPECTED_FILE_HEADER_TEMPLATE}")) ;;
69+
sh) EXPECTED_FILE_HEADER=$(cat <(echo '#!/bin/bash') <(sed -e 's|@@|##|g' <<<"${EXPECTED_FILE_HEADER_TEMPLATE}")) ;;
6870
*) fatal "Unsupported file extension for file (exclude or update this script): ${FILE_PATH}" ;;
6971
esac
7072
EXPECTED_FILE_HEADER_LINECOUNT=$(wc -l <<<"${EXPECTED_FILE_HEADER}")

scripts/generate-contributors-list.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env bash
1+
#!/bin/bash
22
##===----------------------------------------------------------------------===##
33
##
44
## This source file is part of the SwiftOpenAPIGenerator open source project

scripts/run-integration-test.sh

100644100755
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env bash
1+
#!/bin/bash
22
##===----------------------------------------------------------------------===##
33
##
44
## This source file is part of the SwiftOpenAPIGenerator open source project
@@ -24,7 +24,7 @@ JQ_BIN=${JQ_BIN:-$(command -v jq)} || fatal "JQ_BIN unset and no jq on PATH"
2424

2525
CURRENT_SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
2626
REPO_ROOT="$(git -C "${CURRENT_SCRIPT_DIR}" rev-parse --show-toplevel)"
27-
TMP_DIR=$(mktemp -d "${PWD}/tmp.$(basename "$0").XXXXXXXXXX.noindex")
27+
TMP_DIR=$(/usr/bin/mktemp -d -p "${TMPDIR-/tmp}" "$(basename "$0").XXXXXXXXXX")
2828

2929
PACKAGE_PATH=${PACKAGE_PATH:-${REPO_ROOT}}
3030

@@ -43,6 +43,6 @@ swift package --package-path "${INTEGRATION_TEST_PACKAGE_PATH}" \
4343
edit "${PACKAGE_NAME}" --path "${PACKAGE_PATH}"
4444

4545
log "Building integration test package: ${INTEGRATION_TEST_PACKAGE_PATH}"
46-
swift build --package-path "${INTEGRATION_TEST_PACKAGE_PATH}" -Xswiftc -strict-concurrency=complete
46+
swift build --package-path "${INTEGRATION_TEST_PACKAGE_PATH}"
4747

4848
log "✅ Successfully built integration test package."

scripts/run-swift-format.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env bash
1+
#!/bin/bash
22
##===----------------------------------------------------------------------===##
33
##
44
## This source file is part of the SwiftOpenAPIGenerator open source project

scripts/soundness.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env bash
1+
#!/bin/bash
22
##===----------------------------------------------------------------------===##
33
##
44
## This source file is part of the SwiftOpenAPIGenerator open source project

0 commit comments

Comments
 (0)