-
-
Notifications
You must be signed in to change notification settings - Fork 45
98 lines (82 loc) · 2.66 KB
/
swift.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
name: Build and test
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
swift-test-macos:
name: Build and test on ${{ matrix.os }} with Swift ${{ matrix.swift }}, Xcode ${{ matrix.xcode }}
timeout-minutes: 40
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: macos-14
xcode: "15.4"
swift: "6.0"
swift-install:
dir: "swift-6.0-branch/xcode"
version: "swift-6.0-DEVELOPMENT-SNAPSHOT-2024-06-08-a"
- os: macos-14
xcode: "15.4"
swift: "5.10"
- os: macos-13
xcode: "15.2"
swift: "5.9.2"
steps:
- name: Checkout the repository
uses: actions/checkout@v4
- name: Select Xcode version
run: sudo xcode-select --switch /Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer
- name: Install Swift ${{ matrix.swift }}
if: ${{ matrix.swift-install }} != null
run: bash ci/mac/install-swift.bash
env:
SWIFT_DIR: ${{ matrix.swift-install.dir }}
SWIFT_VERSION: ${{ matrix.swift-install.version }}
- name: Check Swift version
run: swift --version
- name: Install dependencies for macOS
run: brew bundle
- name: Build the project
run: swift build --build-tests
- name: Run tests
run: swift test
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
swift-test-linux:
name: Build and test on Linux with Swift ${{ matrix.swift.version }}
timeout-minutes: 40
runs-on: ubuntu-22.04
strategy:
matrix:
include:
- swift:
dir: "swift-5.10-release/ubuntu2204"
version: "swift-5.10-RELEASE"
- swift:
dir: "swift-5.9.2-release/ubuntu2204"
version: "swift-5.9.2-RELEASE"
steps:
- name: Checkout the repository
uses: actions/checkout@v4
- name: Install Swift toolchain
uses: ./.github/actions/install-swift
with:
swift-dir: ${{ matrix.swift.dir }}
swift-version: ${{ matrix.swift.version }}
- name: Check Swift version
run: swift --version
- name: Install dependent packages for WebAssembly
run: >
sudo apt-get update && sudo apt-get install -y
wabt binaryen
- name: Install WebAssembly runtime
uses: bytecodealliance/actions/wasmtime/setup@v1
- name: Build the project
run: swift build --build-tests
- name: Run tests
run: swift test
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}