-
Notifications
You must be signed in to change notification settings - Fork 8
104 lines (91 loc) · 3.64 KB
/
pull_request.yml
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
name: PR
on:
pull_request:
types: [opened, reopened, synchronize]
jobs:
soundness:
name: Soundness
uses: swiftlang/github-workflows/.github/workflows/soundness.yml@main
with:
api_breakage_check_container_image: "swift:6.0-noble"
docs_check_container_image: "swift:6.0-noble"
license_header_check_project_name: "SwiftContainerPlugin"
shell_check_container_image: "swift:6.0-noble"
unit-tests:
name: Unit tests
uses: apple/swift-nio/.github/workflows/unit_tests.yml@main
with:
linux_5_9_enabled: false
linux_5_10_enabled: false
linux_6_0_arguments_override: "--skip SmokeTests"
linux_nightly_6_0_arguments_override: "--skip SmokeTests"
linux_nightly_main_arguments_override: "--skip SmokeTests"
integration-tests:
name: Integration tests
runs-on: ubuntu-latest
services:
registry:
image: registry:2
ports:
- 5000:5000
container:
image: swift:6.0-noble
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Mark the workspace as safe
# https://github.com/actions/checkout/issues/766
run: git config --global --add safe.directory ${GITHUB_WORKSPACE}
- name: Run test job
env:
REGISTRY_HOST: registry
REGISTRY_PORT: 5000
run: |
swift test
endtoend-tests:
name: End to end tests
runs-on: ubuntu-latest
services:
registry:
image: registry:2
ports:
- 5000:5000
strategy:
matrix:
example:
- HelloWorldVapor
- HelloWorldHummingbird
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Mark the workspace as safe
# https://github.com/actions/checkout/issues/766
run: git config --global --add safe.directory ${GITHUB_WORKSPACE}
- name: Install the static SDK
run: |
swift sdk install \
https://download.swift.org/swift-6.0.2-release/static-sdk/swift-6.0.2-RELEASE/swift-6.0.2-RELEASE_static-linux-0.0.1.artifactbundle.tar.gz \
--checksum aa5515476a403797223fc2aad4ca0c3bf83995d5427fb297cab1d93c68cee075
- name: Build the example
run: |
cd Examples/${{ matrix.example }}
sed -i'.bak' -e '/swift-container-plugin/ s/(url:.*),/(path: "..\/.."),/' Package.swift
swift package \
--swift-sdk x86_64-swift-linux-musl \
--allow-network-connections all \
build-container-image \
--repository localhost:5000/${{ lower(matrix.example) }} \
--from scratch
- name: Run the example
run: |
docker run -d --platform linux/amd64 -p 8080:8080 localhost:5000/${{ lower(matrix.example) }}
- name: Check that the service is running
run: |
curl -v localhost:8080 | grep "Hello World"
swift-6-language-mode:
name: Swift 6 Language Mode
uses: apple/swift-nio/.github/workflows/swift_6_language_mode.yml@main