-
Notifications
You must be signed in to change notification settings - Fork 139
160 lines (142 loc) · 6.1 KB
/
ci.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
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
name: CI
on:
push:
branches:
- main
pull_request:
branches:
- '*'
workflow_dispatch:
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
environment:
runs-on: ubuntu-latest
steps:
- run: echo "Preparing Environment Variables..."
outputs:
XCODE_15_VERSION: 15.4
XCODE_16_VERSION: 16.1
XCODE_15_VERSION_IOS: 17.5
XCODE_16_VERSION_IOS: 18.1
XCODE_15_VERSION_TVOS: 17.5
XCODE_16_VERSION_TVOS: 18.1
XCODE_15_VERSION_WATCHOS: 10.5
XCODE_16_VERSION_WATCHOS: 11.1
tests:
runs-on: macos-14
needs: environment
strategy:
matrix:
combination:
- xcode: ${{ needs.environment.outputs.XCODE_15_VERSION }}
variation: ios
os_version: ${{ needs.environment.outputs.XCODE_15_VERSION_IOS }}
- xcode: ${{ needs.environment.outputs.XCODE_16_VERSION }}
variation: ios
os_version: ${{ needs.environment.outputs.XCODE_16_VERSION_IOS }}
- xcode: ${{ needs.environment.outputs.XCODE_15_VERSION }}
variation: tvos
os_version: ${{ needs.environment.outputs.XCODE_15_VERSION_TVOS }}
- xcode: ${{ needs.environment.outputs.XCODE_16_VERSION }}
variation: tvos
os_version: ${{ needs.environment.outputs.XCODE_16_VERSION_TVOS }}
- xcode: ${{ needs.environment.outputs.XCODE_15_VERSION }}
variation: watchos
os_version: ${{ needs.environment.outputs.XCODE_15_VERSION_WATCHOS }}
- xcode: ${{ needs.environment.outputs.XCODE_16_VERSION }}
variation: watchos
os_version: ${{ needs.environment.outputs.XCODE_16_VERSION_WATCHOS }}
- xcode: ${{ needs.environment.outputs.XCODE_15_VERSION }}
variation: macos
- xcode: ${{ needs.environment.outputs.XCODE_16_VERSION }}
variation: macos
- xcode: ${{ needs.environment.outputs.XCODE_15_VERSION }}
variation: examples
os_version: ${{ needs.environment.outputs.XCODE_15_VERSION_IOS }}
- xcode: ${{ needs.environment.outputs.XCODE_16_VERSION }}
variation: examples
os_version: ${{ needs.environment.outputs.XCODE_16_VERSION_IOS }}
steps:
- uses: actions/checkout@v4
- name: Select Xcode ${{ matrix.combination.xcode }}
run: sudo xcode-select -s /Applications/Xcode_${{ matrix.combination.xcode }}.app
- name: Skip macro validation
run: defaults write com.apple.dt.Xcode IDESkipMacroFingerprintValidation -bool YES
- name: Set OS version
run: |
if [[ "${{ matrix.combination.variation }}" == "ios" ]]; then
echo "IOS_VERSION=${{ matrix.combination.os_version }}" >> "$GITHUB_ENV"
elif [[ "${{ matrix.combination.variation }}" == "tvos" ]]; then
echo "TVOS_VERSION=${{ matrix.combination.os_version }}" >> "$GITHUB_ENV"
elif [[ "${{ matrix.combination.variation }}" == "watchos" ]]; then
echo "WATCHOS_VERSION=${{ matrix.combination.os_version }}" >> "$GITHUB_ENV"
elif [[ "${{ matrix.combination.variation }}" == "examples" ]]; then
echo "IOS_VERSION=${{ matrix.combination.os_version }}" >> "$GITHUB_ENV"
fi
- name: Run tests
run: make test-${{ matrix.combination.variation }}
library-evolution:
runs-on: macos-14
needs: environment
strategy:
matrix:
combination:
- xcode: ${{ needs.environment.outputs.XCODE_15_VERSION }}
variation: ios
os_version: ${{ needs.environment.outputs.XCODE_15_VERSION_IOS }}
- xcode: ${{ needs.environment.outputs.XCODE_16_VERSION }}
variation: ios
os_version: ${{ needs.environment.outputs.XCODE_16_VERSION_IOS }}
- xcode: ${{ needs.environment.outputs.XCODE_15_VERSION }}
variation: macos
- xcode: ${{ needs.environment.outputs.XCODE_16_VERSION }}
variation: macos
steps:
- uses: actions/checkout@v4
- name: Select Xcode ${{ matrix.combination.xcode }}
run: sudo xcode-select -s /Applications/Xcode_${{ matrix.combination.xcode }}.app
- name: Skip macro validation
run: defaults write com.apple.dt.Xcode IDESkipMacroFingerprintValidation -bool YES
- name: Set OS version
run: |
if [[ "${{ matrix.combination.variation }}" == "ios" ]]; then
echo "IOS_VERSION=${{ matrix.combination.os_version }}" >> "$GITHUB_ENV"
fi
- name: Run Library Evolution builds
run: make library-evolution-${{ matrix.combination.variation }}
wasm:
name: Wasm
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: bytecodealliance/actions/wasmtime/setup@v1
- name: Install Swift and Swift SDK for WebAssembly
run: |
PREFIX=/opt/swift
set -ex
curl -f -o /tmp/swift.tar.gz "https://download.swift.org/swift-6.0.2-release/ubuntu2204/swift-6.0.2-RELEASE/swift-6.0.2-RELEASE-ubuntu22.04.tar.gz"
sudo mkdir -p $PREFIX; sudo tar -xzf /tmp/swift.tar.gz -C $PREFIX --strip-component 1
$PREFIX/usr/bin/swift sdk install https://github.com/swiftwasm/swift/releases/download/swift-wasm-6.0.2-RELEASE/swift-wasm-6.0.2-RELEASE-wasm32-unknown-wasi.artifactbundle.zip --checksum 6ffedb055cb9956395d9f435d03d53ebe9f6a8d45106b979d1b7f53358e1dcb4
echo "$PREFIX/usr/bin" >> "$GITHUB_PATH"
- name: Build tests
run: swift build --swift-sdk wasm32-unknown-wasi --build-tests -Xlinker -z -Xlinker stack-size=$((1024 * 1024))
- name: Run tests
run: wasmtime --dir . .build/debug/swift-navigationPackageTests.wasm
windows:
name: Windows
strategy:
matrix:
os: [windows-latest]
config: [debug, release]
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- uses: compnerd/gha-setup-swift@main
with:
branch: swift-5.10-release
tag: 5.10-RELEASE
- uses: actions/checkout@v4
- name: Build
run: swift build -c ${{ matrix.config }}