diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml new file mode 100644 index 00000000..922f8b8f --- /dev/null +++ b/.github/workflows/pull_request.yml @@ -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 diff --git a/NOTICE.txt b/NOTICE.txt index 663ca501..b3bfba6f 100644 --- a/NOTICE.txt +++ b/NOTICE.txt @@ -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/ diff --git a/Tools/build-swiftly-release/BuildSwiftlyRelease.swift b/Tools/build-swiftly-release/BuildSwiftlyRelease.swift index 5ac8aaa2..cdec9040 100644 --- a/Tools/build-swiftly-release/BuildSwiftlyRelease.swift +++ b/Tools/build-swiftly-release/BuildSwiftlyRelease.swift @@ -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 { @@ -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 } @@ -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") } diff --git a/docker/docker-compose.1804.yaml b/docker/docker-compose.1804.yaml deleted file mode 100644 index da34363d..00000000 --- a/docker/docker-compose.1804.yaml +++ /dev/null @@ -1,28 +0,0 @@ -version: "3" - -services: - - test-setup: - image: swiftly:18.04-test - build: - args: - base_image: "swift:5.10-bionic" - - test: - image: swiftly:18.04-test - environment: - - SWIFTLY_PLATFORM_NAME=ubuntu1804 - - SWIFTLY_PLATFORM_NAME_FULL=ubuntu18.04 - - SWIFTLY_PLATFORM_NAME_PRETTY="Ubuntu 18.04" - - install-test-setup: - image: swiftly:18.04-install-test - build: - args: - base_image: "ubuntu:bionic" - - install-test: - image: swiftly:18.04-install-test - - shell: - image: swiftly:18.04-test diff --git a/docker/docker-compose.2004.yaml b/docker/docker-compose.2004.yaml deleted file mode 100644 index a4799ace..00000000 --- a/docker/docker-compose.2004.yaml +++ /dev/null @@ -1,28 +0,0 @@ -version: "3" - -services: - - test-setup: - image: swiftly:20.04-test - build: - args: - base_image: "swift:5.10-focal" - - test: - image: swiftly:20.04-test - environment: - - SWIFTLY_PLATFORM_NAME=ubuntu2004 - - SWIFTLY_PLATFORM_NAME_FULL=ubuntu20.04 - - SWIFTLY_PLATFORM_NAME_PRETTY="Ubuntu 20.04" - - install-test-setup: - image: swiftly:20.04-install-test - build: - args: - base_image: "ubuntu:focal" - - install-test: - image: swiftly:20.04-install-test - - shell: - image: swiftly:20.04-test diff --git a/docker/docker-compose.2204.yaml b/docker/docker-compose.2204.yaml deleted file mode 100644 index 824721cd..00000000 --- a/docker/docker-compose.2204.yaml +++ /dev/null @@ -1,28 +0,0 @@ -version: "3" - -services: - - test-setup: - image: swiftly:22.04-test - build: - args: - base_image: "swift:5.10-jammy" - - test: - image: swiftly:22.04-test - environment: - - SWIFTLY_PLATFORM_NAME=ubuntu2204 - - SWIFTLY_PLATFORM_NAME_FULL=ubuntu22.04 - - SWIFTLY_PLATFORM_NAME_PRETTY="Ubuntu 22.04" - - install-test-setup: - image: swiftly:22.04-install-test - build: - args: - base_image: "ubuntu:jammy" - - install-test: - image: swiftly:22.04-install-test - - shell: - image: swiftly:22.04-test diff --git a/docker/docker-compose.amazonlinux2.yaml b/docker/docker-compose.amazonlinux2.yaml deleted file mode 100644 index 4874d2af..00000000 --- a/docker/docker-compose.amazonlinux2.yaml +++ /dev/null @@ -1,32 +0,0 @@ -version: "3" - -services: - - test-setup: - image: swiftly:amazonlinux2-test - build: - context: .. - dockerfile: docker/test-amazonlinux2.dockerfile - args: - base_image: "swift:5.10-amazonlinux2" - - test: - image: swiftly:amazonlinux2-test - environment: - - SWIFTLY_PLATFORM_NAME=amazonlinux2 - - SWIFTLY_PLATFORM_NAME_FULL=amazonlinux2 - - SWIFTLY_PLATFORM_NAME_PRETTY="Amazon Linux 2" - - install-test-setup: - image: swiftly:amazonlinux2-install-test - build: - context: .. - dockerfile: docker/install-test-amazonlinux2.dockerfile - args: - base_image: "amazonlinux:2" - - install-test: - image: swiftly:amazonlinux2-install-test - - shell: - image: swiftly:amazonlinux2-test diff --git a/docker/docker-compose.ubi9.yaml b/docker/docker-compose.ubi9.yaml deleted file mode 100644 index 36c85c5d..00000000 --- a/docker/docker-compose.ubi9.yaml +++ /dev/null @@ -1,32 +0,0 @@ -version: "3" - -services: - - test-setup: - image: swiftly:ubi9-test - build: - context: .. - dockerfile: docker/test-ubi9.dockerfile - args: - base_image: "swift:5.10-rhel-ubi9" - - test: - image: swiftly:ubi9-test - environment: - - SWIFTLY_PLATFORM_NAME=ubi9 - - SWIFTLY_PLATFORM_NAME_FULL=ubi9 - - SWIFTLY_PLATFORM_NAME_PRETTY="Red Hat Enterprise Linux 9" - - install-test-setup: - image: swiftly:ubi9-install-test - build: - context: .. - dockerfile: docker/install-test-ubi9.dockerfile - args: - base_image: "redhat/ubi9:latest" - - install-test: - image: swiftly:ubi9-install-test - - shell: - image: swiftly:ubi9-test diff --git a/docker/docker-compose.yaml b/docker/docker-compose.yaml deleted file mode 100644 index 238e6ec8..00000000 --- a/docker/docker-compose.yaml +++ /dev/null @@ -1,63 +0,0 @@ -# this file is not designed to be run directly -# instead, use the docker-compose..yaml files -# eg docker-compose -f docker/docker-compose.yaml -f docker/docker-compose.1804.yaml run test -version: "3" - -services: - - test-setup: - image: swiftly:default - build: - context: .. - dockerfile: docker/test.dockerfile - - common: &common - image: swiftly:default - volumes: - - ~/.ssh:/root/.ssh - - ..:/code:z - working_dir: /code - cap_drop: - - CAP_NET_RAW - - CAP_NET_BIND_SERVICE - - lint: - <<: *common - image: swiftly:lint - build: - context: .. - dockerfile: docker/lint.dockerfile - command: /usr/bin/env bash -xcl "./scripts/check-lint.sh" - - test: - <<: *common - depends_on: [test-setup] - command: /usr/bin/env bash -xcl "./scripts/run-tests.sh" - - install-test-setup: - image: swiftly:install-default - build: - context: .. - dockerfile: docker/install-test.dockerfile - - install-test-common: &install-test-common - image: swiftly:install-default - depends_on: [install-test-setup] - volumes: - - ~/.ssh:/root/.ssh - - ../install:/swiftly-install:z - working_dir: /swiftly-install - cap_drop: - - CAP_NET_RAW - - CAP_NET_BIND_SERVICE - - install-test: - <<: *install-test-common - command: /usr/bin/env bash -xcl "./run-tests.sh" - - # util - - shell: - <<: *common - depends_on: [test-setup] - entrypoint: /usr/bin/env bash diff --git a/docker/install-test-amazonlinux2.dockerfile b/docker/install-test-amazonlinux2.dockerfile deleted file mode 100644 index dbab2406..00000000 --- a/docker/install-test-amazonlinux2.dockerfile +++ /dev/null @@ -1,5 +0,0 @@ -ARG base_image=amazonlinux:2 -FROM $base_image - -RUN yum install -y curl util-linux gpg -RUN echo 'export PATH="$HOME/.local/bin:$PATH"' >> $HOME/.profile diff --git a/docker/install-test-ubi9.dockerfile b/docker/install-test-ubi9.dockerfile deleted file mode 100644 index 9adea57c..00000000 --- a/docker/install-test-ubi9.dockerfile +++ /dev/null @@ -1,5 +0,0 @@ -ARG base_image=redhat/ubi9:latest -FROM $base_image - -RUN yum install --allowerasing -y curl gcc-c++ gpg -RUN echo 'export PATH="$HOME/.local/bin:$PATH"' >> $HOME/.profile diff --git a/docker/install-test.dockerfile b/docker/install-test.dockerfile deleted file mode 100644 index d1232df1..00000000 --- a/docker/install-test.dockerfile +++ /dev/null @@ -1,12 +0,0 @@ -ARG base_image=ubuntu:jammy -FROM $base_image - -# set as UTF-8 -RUN apt-get update && apt-get install -y locales locales-all sqlite3 -ENV LC_ALL en_US.UTF-8 -ENV LANG en_US.UTF-8 -ENV LANGUAGE en_US.UTF-8 - -# dependencies -RUN apt-get update --fix-missing && apt-get install -y curl gpg -RUN echo 'export PATH="$HOME/.local/bin:$PATH"' >> $HOME/.profile diff --git a/docker/lint.dockerfile b/docker/lint.dockerfile deleted file mode 100644 index 239ae71e..00000000 --- a/docker/lint.dockerfile +++ /dev/null @@ -1,7 +0,0 @@ -FROM swift:jammy - -# set as UTF-8 -RUN apt-get update && apt-get install -y locales locales-all -ENV LC_ALL en_US.UTF-8 -ENV LANG en_US.UTF-8 -ENV LANGUAGE en_US.UTF-8 diff --git a/docker/test-amazonlinux2.dockerfile b/docker/test-amazonlinux2.dockerfile deleted file mode 100644 index f5091034..00000000 --- a/docker/test-amazonlinux2.dockerfile +++ /dev/null @@ -1,17 +0,0 @@ -ARG base_image=swift:5.10-amazonlinux2 -FROM $base_image -# needed to do again after FROM due to docker limitation -ARG swift_version -ARG ubuntu_version - -# dependencies -RUN yum install -y \ - curl \ - gcc \ - gcc-c++ \ - make \ - gpg -COPY ./scripts/install-libarchive.sh / -RUN /install-libarchive.sh - -RUN curl -L https://swift.org/keys/all-keys.asc | gpg --import diff --git a/docker/test-ubi9.dockerfile b/docker/test-ubi9.dockerfile deleted file mode 100644 index 110efd6a..00000000 --- a/docker/test-ubi9.dockerfile +++ /dev/null @@ -1,17 +0,0 @@ -ARG base_image=swift:5.10-rhel-ubi9 -FROM $base_image -# needed to do again after FROM due to docker limitation -ARG swift_version -ARG ubuntu_version - -# dependencies -RUN yum install -y --allowerasing \ - curl \ - gcc \ - gcc-c++ \ - make \ - gpg -COPY ./scripts/install-libarchive.sh / -RUN /install-libarchive.sh - -RUN curl -L https://swift.org/keys/all-keys.asc | gpg --import diff --git a/docker/test.dockerfile b/docker/test.dockerfile deleted file mode 100644 index a5e7acb7..00000000 --- a/docker/test.dockerfile +++ /dev/null @@ -1,20 +0,0 @@ -ARG swift_version=5.10 -ARG ubuntu_version=jammy -ARG base_image=swift:$swift_version-$ubuntu_version -FROM $base_image -# needed to do again after FROM due to docker limitation -ARG swift_version -ARG ubuntu_version - -# set as UTF-8 -RUN apt-get update && apt-get install -y locales locales-all -ENV LC_ALL en_US.UTF-8 -ENV LANG en_US.UTF-8 -ENV LANGUAGE en_US.UTF-8 - -# dependencies -RUN apt-get update --fix-missing && apt-get install -y curl build-essential gpg -COPY ./scripts/install-libarchive.sh / -RUN /install-libarchive.sh - -RUN curl -L https://swift.org/keys/all-keys.asc | gpg --import