Skip to content

Commit 5c7be85

Browse files
committed
Convert jobs to bootstrap with swiftly
1 parent e76ad1d commit 5c7be85

File tree

2 files changed

+63
-14
lines changed

2 files changed

+63
-14
lines changed

.github/workflows/build_release.yml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,30 @@ on:
1414
type: string
1515
default: "--skip"
1616

17+
env:
18+
SWIFTLY_BOOTSTRAP_VERSION: 0.4.0-dev
19+
1720
jobs:
1821
buildrelease:
1922
name: Build Release
2023
runs-on: ubuntu-latest
2124
container:
22-
image: "swift:6.0-rhel-ubi9"
25+
image: "redhat/ubi9"
2326
steps:
2427
- name: Checkout repository
2528
uses: actions/checkout@v4
29+
- name: Prepare the action
30+
run: ./scripts/prep-gh-action.sh
31+
- name: Install swiftly
32+
run: bash -c 'curl -O https://download.swift.org/swiftly/linux/swiftly-${SWIFTLY_BOOTSTRAP_VERSION}-$(uname -m).tar.gz && tar zxf swiftly-*.tar.gz && ./swiftly init -y --skip-install'
33+
- name: Update environment
34+
run: bash -c '. "/root/.local/share/swiftly/env.sh" && echo "PATH=$PATH" >> "$GITHUB_ENV" && echo "SWIFTLY_HOME_DIR=$SWIFTLY_HOME_DIR" >> "$GITHUB_ENV" && echo "SWIFTLY_BIN_DIR=$SWIFTLY_BIN_DIR" >> "$GITHUB_ENV"'
35+
- name: Install selected swift toolchain
36+
run: swiftly install --post-install-file=post-install.sh
37+
- name: Perform swift toolchain post-installation
38+
run: chmod u+x post-install.sh && ./post-install.sh
39+
- name: Display swift version
40+
run: swift --version
2641
- name: Build Release Artifact
2742
run: swift run build-swiftly-release --use-rhel-ubi9 ${{ inputs.skip }} ${{ inputs.version }}
2843
- name: Upload Release Artifact

.github/workflows/pull_request.yml

Lines changed: 47 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
unacceptable_language_check_enabled: true
2424

2525
tests-selfhosted:
26-
name: Test Self Hosted
26+
name: Test (Self Hosted) - ${{ matrix.container }}
2727
runs-on: ubuntu-latest
2828
strategy:
2929
fail-fast: false
@@ -34,7 +34,7 @@ jobs:
3434
steps:
3535
- name: Checkout repository
3636
uses: actions/checkout@v4
37-
- name: Prepare image
37+
- name: Prepare the action
3838
run: ./scripts/prep-gh-action.sh
3939
- name: Install swiftly
4040
run: bash -c 'curl -O https://download.swift.org/swiftly/linux/swiftly-${SWIFTLY_BOOTSTRAP_VERSION}-$(uname -m).tar.gz && tar zxf swiftly-*.tar.gz && ./swiftly init -y --skip-install'
@@ -63,10 +63,22 @@ jobs:
6363
name: Release Build Check
6464
runs-on: ubuntu-latest
6565
container:
66-
image: "swift:6.0-rhel-ubi9"
66+
image: "redhat/ubi9"
6767
steps:
6868
- name: Checkout repository
6969
uses: actions/checkout@v4
70+
- name: Prepare the action
71+
run: ./scripts/prep-gh-action.sh
72+
- name: Install swiftly
73+
run: bash -c 'curl -O https://download.swift.org/swiftly/linux/swiftly-${SWIFTLY_BOOTSTRAP_VERSION}-$(uname -m).tar.gz && tar zxf swiftly-*.tar.gz && ./swiftly init -y --skip-install'
74+
- name: Update environment
75+
run: bash -c '. "/root/.local/share/swiftly/env.sh" && echo "PATH=$PATH" >> "$GITHUB_ENV" && echo "SWIFTLY_HOME_DIR=$SWIFTLY_HOME_DIR" >> "$GITHUB_ENV" && echo "SWIFTLY_BIN_DIR=$SWIFTLY_BIN_DIR" >> "$GITHUB_ENV"'
76+
- name: Install selected swift toolchain
77+
run: swiftly install --post-install-file=post-install.sh
78+
- name: Perform swift toolchain post-installation
79+
run: chmod u+x post-install.sh && ./post-install.sh
80+
- name: Display swift version
81+
run: swift --version
7082
- name: Build Artifact
7183
run: swift run build-swiftly-release --use-rhel-ubi9 --skip "999.0.0"
7284
- name: Upload Artifact
@@ -79,25 +91,47 @@ jobs:
7991

8092
formatcheck:
8193
name: Format Check
82-
uses: swiftlang/github-workflows/.github/workflows/swift_package_test.yml@main
83-
with:
84-
# We only need to run this with one swift release and on one of the linux distributions
85-
linux_os_versions: "[\"jammy\"]"
86-
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\"}]"
87-
linux_pre_build_command: ./scripts/prep-gh-action.sh
88-
linux_build_command: swift run swiftformat --lint --dryrun . || (echo "Please run 'swift run swiftformat .' to format the source code."; exit 1)
89-
enable_windows_checks: false
94+
runs-on: ubuntu-latest
95+
container:
96+
image: ubuntu:22.04
97+
steps:
98+
- name: Checkout repository
99+
uses: actions/checkout@v4
100+
- name: Prepare the action
101+
run: ./scripts/prep-gh-action.sh
102+
- name: Install swiftly
103+
run: bash -c 'curl -O https://download.swift.org/swiftly/linux/swiftly-${SWIFTLY_BOOTSTRAP_VERSION}-$(uname -m).tar.gz && tar zxf swiftly-*.tar.gz && ./swiftly init -y --skip-install'
104+
- name: Update environment
105+
run: bash -c '. "/root/.local/share/swiftly/env.sh" && echo "PATH=$PATH" >> "$GITHUB_ENV" && echo "SWIFTLY_HOME_DIR=$SWIFTLY_HOME_DIR" >> "$GITHUB_ENV" && echo "SWIFTLY_BIN_DIR=$SWIFTLY_BIN_DIR" >> "$GITHUB_ENV"'
106+
- name: Install selected swift toolchain
107+
run: swiftly install --post-install-file=post-install.sh
108+
- name: Perform swift toolchain post-installation
109+
run: chmod u+x post-install.sh && ./post-install.sh
110+
- name: Display swift version
111+
run: swift --version
112+
- name: Check format
113+
run: swift run swiftformat --lint --dryrun . || (echo "Please run 'swift run swiftformat .' to format the source code."; exit 1)
90114

91115
docscheck:
92116
name: Documentation Check
93117
runs-on: ubuntu-latest
94118
container:
95-
image: "swift:6.0-noble"
119+
image: ubuntu:22.04
96120
steps:
97121
- name: Checkout repository
98122
uses: actions/checkout@v4
99123
- name: Prepare the action
100-
run: ./scripts/prep-gh-action.sh && ./scripts/install-libarchive.sh
124+
run: ./scripts/prep-gh-action.sh
125+
- name: Install swiftly
126+
run: bash -c 'curl -O https://download.swift.org/swiftly/linux/swiftly-${SWIFTLY_BOOTSTRAP_VERSION}-$(uname -m).tar.gz && tar zxf swiftly-*.tar.gz && ./swiftly init -y --skip-install'
127+
- name: Update environment
128+
run: bash -c '. "/root/.local/share/swiftly/env.sh" && echo "PATH=$PATH" >> "$GITHUB_ENV" && echo "SWIFTLY_HOME_DIR=$SWIFTLY_HOME_DIR" >> "$GITHUB_ENV" && echo "SWIFTLY_BIN_DIR=$SWIFTLY_BIN_DIR" >> "$GITHUB_ENV"'
129+
- name: Install selected swift toolchain
130+
run: swiftly install --post-install-file=post-install.sh
131+
- name: Perform swift toolchain post-installation
132+
run: chmod u+x post-install.sh && ./post-install.sh
133+
- name: Display swift version
134+
run: swift --version
101135
- name: Generate Swiftly CLI Reference and Check for Differences
102136
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)
103137
- name: Generate Documentation Set

0 commit comments

Comments
 (0)