-
Notifications
You must be signed in to change notification settings - Fork 68
195 lines (184 loc) · 7.02 KB
/
pull_request.yml
File metadata and controls
195 lines (184 loc) · 7.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
name: Pull Request
permissions:
contents: read
on:
pull_request:
types: [opened, reopened, synchronize]
push:
branches: [main, 'release/*']
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
macos-tests-selfhosted:
name: Test (Self Hosted) / macOS Tahoe ARM64
runs-on: [self-hosted, macos, tahoe, ARM64]
if: ${{ github.repository == 'swiftlang/swiftly' }}
strategy:
fail-fast: false
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Prepare the action
run: ./scripts/prep-gh-action.sh --install-swiftly
- name: Build and Test
run: swift test
timeout-minutes: 60
tests-selfhosted:
name: Test (Self Hosted) / ${{ matrix.container }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
container: ["ubuntu:22.04", "ubuntu:24.04", "redhat/ubi9", "debian:12", "fedora:39"]
container:
image: ${{ matrix.container }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Prepare the action
run: ./scripts/prep-gh-action.sh --install-swiftly
- name: Build and Test
# UBI 9 - See https://github.com/swiftlang/swift/issues/80908
# UBI 9 - See https://github.com/swiftlang/swift/issues/80909
run: bash -c 'if [[ "${{ matrix.container }}" == "redhat/ubi9" ]]; then swift build --build-tests; else swift test; fi'
releasebuildcheck:
name: Release Build Check / Linux
runs-on: ubuntu-latest
container:
image: "redhat/ubi9"
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Prepare the action
run: ./scripts/prep-gh-action.sh --install-swiftly
- name: Build Artifact
run: swift run build-swiftly-release --test --skip "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: test-swiftly-linux-x86_64
path: .build/debug/test-swiftly-linux-x86_64.tar.gz
if-no-files-found: error
retention-days: 1
releasebuildcheckmacos:
name: Release Build Check / macOS
runs-on: [self-hosted, macos, tahoe, ARM64]
if: ${{ github.repository == 'swiftlang/swiftly' }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Prepare the action
run: ./scripts/prep-gh-action.sh --install-swiftly
- name: Build Artifact
run: swift run build-swiftly-release --test --skip "999.0.0"
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: swiftly-release-darwin
path: .build/release/swiftly-*.pkg
if-no-files-found: error
retention-days: 1
- name: Upload Tests
uses: actions/upload-artifact@v4
with:
name: test-swiftly-macos
path: .build/release/test-swiftly-macos.tar.gz
if-no-files-found: error
retention-days: 1
releasetest:
name: Test Release / ${{matrix.shell.pkg}}
needs: releasebuildcheck
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
shell: [
{"pkg": "bash", "bin": "/bin/bash"},
{"pkg": "zsh", "bin": "/bin/zsh"},
{"pkg": "fish", "bin": "/bin/fish"}
]
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 ${{matrix.shell.pkg}} && chsh -s ${{matrix.shell.bin}}
- name: Download Release
uses: actions/download-artifact@v4
with:
name: swiftly-release-x86_64
- name: Download Tests
uses: actions/download-artifact@v4
with:
name: test-swiftly-linux-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 && ./test-swiftly -y ./swiftly.tar.gz
release-custom-install-test:
name: Test Release - Custom Install Location
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
- name: Download Release
uses: actions/download-artifact@v4
with:
name: swiftly-release-x86_64
- name: Download Tests
uses: actions/download-artifact@v4
with:
name: test-swiftly-linux-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 && ./test-swiftly -y --custom-location ./swiftly.tar.gz
formatcheck:
name: Format Check
runs-on: ubuntu-latest
container:
image: ubuntu:22.04
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Prepare the action
run: ./scripts/prep-gh-action.sh --install-swiftly
- name: Check format
run: swift run swiftformat --lint --dryrun . || (echo "Please run 'swift run swiftformat .' to format the source code."; exit 1)
docscheck:
name: Documentation Check
runs-on: ubuntu-latest
container:
image: ubuntu:24.04
steps:
- name: Install git
run: apt-get update && apt-get -y install git
- name: Checkout repository
uses: actions/checkout@v4
- name: Prepare the action
run: ./scripts/prep-gh-action.sh --install-swiftly
- name: Generate Swiftly CLI Reference and Check for Differences
run: swift package plugin --allow-writing-to-package-directory generate-docs-reference && bash -c '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