From 381bf08f8fdec5915ae5b749fc0e2e34010455e3 Mon Sep 17 00:00:00 2001 From: Rick Newton-Rogers Date: Thu, 10 Oct 2024 10:46:42 +0100 Subject: [PATCH] Migrate to GitHub Actions reusable workflows (1) (#70) * Migrate to GitHub Actions reusable workflows (1) Motivation: Migrate to GitHub Actions reusable workflows whilst keeping CI green. Modifications: As the first step in migrating to use GitHub actions this PR provides the workflows which will be used in the future, at first in disabled state so that we can keep CI green during the changeover. Result: Once this PR is merged we can: * Enable the new CI * In a future PR neutralize the old CI scripts * Disable the old CI via GitHub * In a future PR Delete the old CI scripts * add scheduled GHA CI * Update .github/workflows/pull_request.yml Co-authored-by: Franz Busch * review comments --------- Co-authored-by: Franz Busch --- .github/workflows/pull_request.yml | 41 ++++++++++++++++++ .github/workflows/scheduled.yml | 16 +++++++ .licenseignore | 43 +++++++++++++++++++ Benchmarks/Package.swift | 6 +-- Package.swift | 2 +- ...esholds => update-benchmark-thresholds.sh} | 0 6 files changed, 104 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/pull_request.yml create mode 100644 .github/workflows/scheduled.yml create mode 100644 .licenseignore rename dev/{update-benchmark-thresholds => update-benchmark-thresholds.sh} (100%) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml new file mode 100644 index 0000000..d055380 --- /dev/null +++ b/.github/workflows/pull_request.yml @@ -0,0 +1,41 @@ +name: PR + +on: + pull_request: + types: [opened, reopened, synchronize] + +jobs: + soundness: + name: Soundness + uses: swiftlang/github-workflows/.github/workflows/soundness.yml@main + with: + # These are set to false to stage this in with the old CI. + # A follow-up PR will cut them over. + api_breakage_check_enabled: false + broken_symlink_check_enabled: false + docs_check_enabled: false + format_check_enabled: false + license_header_check_enabled: false + license_header_check_project_name: "SwiftASN1" + shell_check_enabled: false + unacceptable_language_check_enabled: false + unit-tests: + name: Unit tests + uses: apple/swift-nio/.github/workflows/unit_tests.yml@main + with: + linux_5_8_enabled: false + linux_5_9_arguments_override: "-Xswiftc -warnings-as-errors --explicit-target-dependency-import-check error" + linux_5_10_arguments_override: "-Xswiftc -warnings-as-errors --explicit-target-dependency-import-check error" + linux_nightly_6_0_arguments_override: "--explicit-target-dependency-import-check error" + linux_nightly_main_arguments_override: "--explicit-target-dependency-import-check error" + + cxx-interop: + name: Cxx interop + uses: apple/swift-nio/.github/workflows/cxx_interop.yml@main + with: + linux_5_8_enabled: false + + swift-6-language-mode: + name: Swift 6 Language Mode + uses: apple/swift-nio/.github/workflows/swift_6_language_mode.yml@main + if: false # Disabled for now. diff --git a/.github/workflows/scheduled.yml b/.github/workflows/scheduled.yml new file mode 100644 index 0000000..ac7ff07 --- /dev/null +++ b/.github/workflows/scheduled.yml @@ -0,0 +1,16 @@ +name: Scheduled + +on: + schedule: + - cron: "0 8,20 * * *" + +jobs: + unit-tests: + name: Unit tests + uses: apple/swift-nio/.github/workflows/unit_tests.yml@main + with: + linux_5_8_enabled: false + linux_5_9_arguments_override: "--explicit-target-dependency-import-check error" + linux_5_10_arguments_override: "--explicit-target-dependency-import-check error" + linux_nightly_6_0_arguments_override: "--explicit-target-dependency-import-check error" + linux_nightly_main_arguments_override: "--explicit-target-dependency-import-check error" diff --git a/.licenseignore b/.licenseignore new file mode 100644 index 0000000..41cebc9 --- /dev/null +++ b/.licenseignore @@ -0,0 +1,43 @@ +.gitignore +**/.gitignore +.licenseignore +.gitattributes +.git-blame-ignore-revs +.mailfilter +.mailmap +.spi.yml +.swift-format +.editorconfig +.github/* +*.md +*.txt +*.yml +*.yaml +*.json +Package.swift +**/Package.swift +Package@-*.swift +**/Package@-*.swift +Package.resolved +**/Package.resolved +Makefile +*.modulemap +**/*.modulemap +**/*.docc/* +*.xcprivacy +**/*.xcprivacy +*.symlink +**/*.symlink +Dockerfile +**/Dockerfile +Sources/CMakeLists.txt +Sources/SwiftASN1/CMakeLists.txt +dev/alloc-limits-from-test-output +dev/boxed-existentials.d +dev/git.commit.template +dev/lldb-smoker +dev/make-single-file-spm +dev/malloc-aggregation.d +dev/update-alloc-limits-to-last-completed-ci-build +Benchmarks/Benchmarks/SwiftASN1Benchmark/ca-certificates/*.crt +Benchmarks/Benchmarks/SwiftASN1Benchmark/ca-certificates/*/*.crt diff --git a/Benchmarks/Package.swift b/Benchmarks/Package.swift index 5f5a34d..cfa2b00 100644 --- a/Benchmarks/Package.swift +++ b/Benchmarks/Package.swift @@ -18,7 +18,7 @@ import PackageDescription let package = Package( name: "benchmarks", platforms: [ - .macOS(.v13), + .macOS(.v13) ], dependencies: [ .package(path: "../"), @@ -33,11 +33,11 @@ let package = Package( ], path: "Benchmarks/SwiftASN1Benchmark", resources: [ - .copy("ca-certificates/"), + .copy("ca-certificates/") ], plugins: [ .plugin(name: "BenchmarkPlugin", package: "package-benchmark") ] - ), + ) ] ) diff --git a/Package.swift b/Package.swift index 0149d42..368e011 100644 --- a/Package.swift +++ b/Package.swift @@ -23,7 +23,7 @@ let upcomingFeatureSwiftSettings: [SwiftSetting] = [ let package = Package( name: "swift-asn1", products: [ - .library(name: "SwiftASN1", targets: ["SwiftASN1"]), + .library(name: "SwiftASN1", targets: ["SwiftASN1"]) ], targets: [ .target( diff --git a/dev/update-benchmark-thresholds b/dev/update-benchmark-thresholds.sh similarity index 100% rename from dev/update-benchmark-thresholds rename to dev/update-benchmark-thresholds.sh