Skip to content

Add a github workflow for Linux based on the swiftlang template #184

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 13 commits into from
Nov 7, 2024
Merged
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
52 changes: 52 additions & 0 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Pull request

on:
pull_request:
types: [opened, reopened, synchronize]

jobs:
soundness:
name: Soundness
uses: swiftlang/github-workflows/.github/workflows/soundness.yml@main
with:
license_header_check_enabled: false
license_header_check_project_name: "Swift.org"
api_breakage_check_enabled: false
docs_check_enabled: false
format_check_enabled: false
shell_check_enabled: false
unacceptable_language_check_enabled: true

tests:
name: Test
uses: swiftlang/github-workflows/.github/workflows/swift_package_test.yml@main
with:
# linux_os_versions: "[\"jammy\", \"noble\", \"focal\", \"amazonlinux2\", \"rhel-ubi9\", \"bookworm\", \"fedora39\"]"
# Not working: noble (compile error in TSC FileSystem), bookworm (missing memory.h), fedora39 (missing memory.h)
linux_os_versions: "[\"jammy\", \"focal\", \"rhel-ubi9\"]"
# We only care about the current stable release, because that's where we make our swiftly releases
linux_exclude_swift_versions: "[{\"swift_version\": \"nightly-main\"},{\"swift_version\": \"nightly-6.0\"},{\"swift_version\": \"5.8\"},{\"swift_version\": \"5.9\"},{\"swift_version\": \"5.10\"}]"
linux_pre_build_command: ((apt-get update && apt-get -y install curl make) || ((curl --help || yum -y install curl) && yum -y install make)) && ./scripts/install-libarchive.sh
enable_windows_checks: false

releasebuild:
name: Release Build
uses: swiftlang/github-workflows/.github/workflows/swift_package_test.yml@main
with:
linux_os_versions: "[\"rhel-ubi9\"]"
# We only care about the current stable release, because that's where we make our swiftly releases
linux_exclude_swift_versions: "[{\"swift_version\": \"nightly-main\"},{\"swift_version\": \"nightly-6.0\"},{\"swift_version\": \"5.8\"},{\"swift_version\": \"5.9\"},{\"swift_version\": \"5.10\"}]"
linux_pre_build_command: echo ""
linux_build_command: swift run build-swiftly-release --skip 0.4.0
enable_windows_checks: false

formatcheck:
name: Format Check
uses: swiftlang/github-workflows/.github/workflows/swift_package_test.yml@main
with:
# We only need to run this with one swift release and on one of the linux distributions
linux_os_versions: "[\"jammy\"]"
linux_exclude_swift_versions: "[{\"swift_version\": \"nightly-main\"},{\"swift_version\": \"nightly-6.0\"},{\"swift_version\": \"5.8\"},{\"swift_version\": \"5.9\"},{\"swift_version\": \"5.10\"}]"
linux_pre_build_command: echo ""
linux_build_command: swift run swiftformat --lint --dryrun .
enable_windows_checks: false
2 changes: 1 addition & 1 deletion NOTICE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,6 @@ following third party libraries:
* libarchive - Copyright (c) 2003-2018 Tim Kientzle. All rights reserved.

* LICENSE ("New BSD license"):
* https://raw.githubusercontent.com/libarchive/libarchive/master/COPYING
* https://raw.githubusercontent.com/libarchive/libarchive/release/COPYING
* HOMEPAGE:
* http://www.libarchive.org/
6 changes: 3 additions & 3 deletions Tools/build-swiftly-release/BuildSwiftlyRelease.swift
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ public func getShell() async throws -> String {
}
#endif

public func isAmazonLinux2() -> Bool {
public func isRHEL9() -> Bool {
let osReleaseFiles = ["/etc/os-release", "/usr/lib/os-release"]
var releaseFile: String?
for file in osReleaseFiles {
Expand Down Expand Up @@ -165,7 +165,7 @@ public func isAmazonLinux2() -> Bool {
return false
}

guard let versionID = versionID, versionID == "2", (id + idlike).contains("amzn") else {
guard let versionID, versionID.hasPrefix("9"), (id + idlike).contains("rhel") else {
return false
}

Expand Down Expand Up @@ -287,7 +287,7 @@ struct BuildSwiftlyRelease: AsyncParsableCommand {

func buildLinuxRelease() async throws {
// Check system requirements
guard isAmazonLinux2() else {
guard isRHEL9() else {
// TODO: see if docker can be used to spawn an Amazon Linux 2 container to continue the release building process
throw Error(message: "Linux releases must be made from Amazon Linux 2 because it has the oldest version of glibc for maximum compatibility with other versions of Linux")
}
Expand Down
28 changes: 0 additions & 28 deletions docker/docker-compose.1804.yaml

This file was deleted.

28 changes: 0 additions & 28 deletions docker/docker-compose.2004.yaml

This file was deleted.

28 changes: 0 additions & 28 deletions docker/docker-compose.2204.yaml

This file was deleted.

32 changes: 0 additions & 32 deletions docker/docker-compose.amazonlinux2.yaml

This file was deleted.

32 changes: 0 additions & 32 deletions docker/docker-compose.ubi9.yaml

This file was deleted.

63 changes: 0 additions & 63 deletions docker/docker-compose.yaml

This file was deleted.

5 changes: 0 additions & 5 deletions docker/install-test-amazonlinux2.dockerfile

This file was deleted.

5 changes: 0 additions & 5 deletions docker/install-test-ubi9.dockerfile

This file was deleted.

12 changes: 0 additions & 12 deletions docker/install-test.dockerfile

This file was deleted.

7 changes: 0 additions & 7 deletions docker/lint.dockerfile

This file was deleted.

17 changes: 0 additions & 17 deletions docker/test-amazonlinux2.dockerfile

This file was deleted.

17 changes: 0 additions & 17 deletions docker/test-ubi9.dockerfile

This file was deleted.

20 changes: 0 additions & 20 deletions docker/test.dockerfile

This file was deleted.