forked from GraphQLSwift/ci
-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (60 loc) · 1.73 KB
/
test.yaml
File metadata and controls
65 lines (60 loc) · 1.73 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
name: Test
on:
workflow_call:
inputs:
package_path:
type: string
required: false
default: ''
description: "Specifies a subpath of the checkout that the package is contained in."
include_android:
type: boolean
description: "Whether testing should include an Android target."
default: true
env:
PACKAGE_PATH: ${{ inputs.package_path != '' && format('--package-path={0}', inputs.package_path) || '' }}
jobs:
macos:
name: Test on macOS
runs-on: macos-latest
steps:
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable
- uses: actions/checkout@v4
- name: Build and test
run: |
swift test \
--parallel \
${{ inputs.package_path != '' && format('--package-path={0}', inputs.package_path) || '' }}
linux:
name: Test on Linux - ${{ matrix.swift-image }}
strategy:
matrix:
swift-image:
- "swift:5.10-jammy"
- "swift:5.10-noble"
- "swift:6.0-jammy"
- "swift:6.0-noble"
- "swift:6.1-jammy"
- "swift:6.1-noble"
runs-on: ubuntu-latest
container: ${{ matrix.swift-image }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Test
run: |
swift test \
--parallel \
${{ inputs.package_path != '' && format('--package-path={0}', inputs.package_path) || '' }}
android:
name: Test on Android
if: ${{ inputs.include_android }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Test
uses: skiptools/swift-android-action@v2
with:
package-path: ${{ inputs.package_path != '' && inputs.package_path || '.' }}