Test swiftly release artifacts in a plain Linux environment #89
Workflow file for this run
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
name: Pull Request | |
on: | |
pull_request: | |
types: [opened, reopened, synchronize] | |
push: | |
branches: [main] | |
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: | |
# Amazon Linux 2 won't work with GH infrastructure | |
linux_os_versions: "[\"jammy\", \"focal\", \"rhel-ubi9\", \"noble\", \"bookworm\", \"fedora39\"]" | |
# 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: ./scripts/prep-gh-action.sh && ./scripts/install-libarchive.sh | |
enable_windows_checks: false | |
releasebuildcheck: | |
name: Release Build Check | |
runs-on: ubuntu-latest | |
container: | |
image: "swift:6.0-rhel-ubi9" | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Build Artifact | |
run: swift run build-swiftly-release --skip --tests "999.0.0" | |
- name: Upload Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: swiftly-release-x86_64 | |
path: .build/release/swiftly-*.tar.gz | |
if-no-files-found: error | |
retention-days: 1 | |
- name: Upload Tests | |
uses: actions/upload-artifact@v4 | |
with: | |
name: swiftly-tests-x86_64 | |
path: .build/debug/test-swiftly.tar.gz | |
if-no-files-found: error | |
retention-days: 1 | |
releasetest: | |
name: Test Release | |
needs: releasebuildcheck | |
runs-on: ubuntu-latest | |
container: | |
image: "ubuntu:22.04" | |
steps: | |
- name: Prepare System | |
run: apt-get update && DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get -y install ca-certificates gpg tzdata | |
- name: Download Release | |
uses: actions/download-artifact@v4 | |
with: | |
name: swiftly-release-x86_64 | |
- name: Download Tests | |
uses: actions/download-artifact@v4 | |
with: | |
name: swiftly-tests-x86_64 | |
- name: Extract and Run Workflow Tests | |
run: cp swiftly-*.tar.gz /root/swiftly.tar.gz && cp test-swiftly.tar.gz /root && cd /root && tar zxf test-swiftly.tar.gz && SWIFTLY_SYSTEM_MUTATING=1 ./swiftlyPackageTests.xctest SwiftlyTests.E2ETests/testAutomatedWorkflow | |
releasetestzsh: | |
name: Test Release ZSH | |
needs: releasebuildcheck | |
runs-on: ubuntu-latest | |
container: | |
image: "ubuntu:24.04" | |
steps: | |
- name: Prepare System | |
run: apt-get update && DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get -y install ca-certificates gpg tzdata zsh && chsh -s /bin/zsh && echo '. /root/.zprofile' > /root/.zshenv | |
- name: Download Release | |
uses: actions/download-artifact@v4 | |
with: | |
name: swiftly-release-x86_64 | |
- name: Download Tests | |
uses: actions/download-artifact@v4 | |
with: | |
name: swiftly-tests-x86_64 | |
- name: Extract and Run Workflow Tests | |
run: cp swiftly-*.tar.gz /root/swiftly.tar.gz && cp test-swiftly.tar.gz /root && cd /root && tar zxf test-swiftly.tar.gz && SWIFTLY_SYSTEM_MUTATING=1 ./swiftlyPackageTests.xctest SwiftlyTests.E2ETests/testAutomatedWorkflow | |
releasetestfish: | |
name: Test Release FISH | |
needs: releasebuildcheck | |
runs-on: ubuntu-latest | |
container: | |
image: "ubuntu:24.04" | |
steps: | |
- name: Prepare System | |
run: apt-get update && DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get -y install ca-certificates gpg tzdata fish && chsh -s /bin/fish | |
- name: Download Release | |
uses: actions/download-artifact@v4 | |
with: | |
name: swiftly-release-x86_64 | |
- name: Download Tests | |
uses: actions/download-artifact@v4 | |
with: | |
name: swiftly-tests-x86_64 | |
- name: Extract and Run Workflow Tests | |
run: cp swiftly-*.tar.gz /root/swiftly.tar.gz && cp test-swiftly.tar.gz /root && cd /root && tar zxf test-swiftly.tar.gz && SWIFTLY_SYSTEM_MUTATING=1 ./swiftlyPackageTests.xctest SwiftlyTests.E2ETests/testAutomatedWorkflow | |
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: ./scripts/prep-gh-action.sh | |
linux_build_command: swift run swiftformat --lint --dryrun . || (echo "Please run 'swift run swiftformat .' to format the source code."; exit 1) | |
enable_windows_checks: false | |
docscheck: | |
name: Documentation Check | |
runs-on: ubuntu-latest | |
container: | |
image: "swift:6.0-noble" | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Prepare the action | |
run: ./scripts/prep-gh-action.sh && ./scripts/install-libarchive.sh | |
- name: Generate Swiftly CLI Reference and Check for Differences | |
run: swift package plugin --allow-writing-to-package-directory generate-docs-reference && git config --global --add safe.directory $(pwd) && git diff --exit-code Documentation/SwiftlyDocs.docc/swiftly-cli-reference.md || (echo "The documentation hasn't been updated with the latest swiftly command-line reference. Please run 'swift package plugin generate-docs-reference' and commit/push the changes."; exit 1) | |
- name: Generate Documentation Set | |
run: swift package --allow-writing-to-directory .build/docs generate-documentation --target SwiftlyDocs --output-path .build/docs | |
- name: Upload Documentation Artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: swiftly-docs | |
path: .build/docs/** | |
if-no-files-found: error | |
retention-days: 1 |