generated from Apodini/Template-Repository
-
Notifications
You must be signed in to change notification settings - Fork 0
104 lines (101 loc) · 3.31 KB
/
build-and-test.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
#
# This source file is part of the Collector-Analyst-Presenter Example open source project
#
# SPDX-FileCopyrightText: 2021 Paul Schmiedmayer and the project authors (see CONTRIBUTORS.md) <paul.schmiedmayer@tum.de>
#
# SPDX-License-Identifier: MIT
#
name: Build and Test
on:
push:
branches:
- develop
pull_request:
branches:
- develop
workflow_dispatch:
jobs:
macosclient:
name: macOS Client
runs-on: macos-11
steps:
- uses: actions/checkout@v2
- uses: maxim-lobanov/setup-xcode@v1.1
with:
xcode-version: latest-stable
- name: Check Xcode version
run: xcodebuild -version
- name: Check Swift version
run: swift --version
- name: Build and test
run: xcodebuild test -scheme Example -destination 'platform=iOS Simulator,name=iPhone 13'
macoswebservices:
name: macOS ${{ matrix.webservice }} ${{ matrix.configuration }}
runs-on: macos-11
strategy:
fail-fast: false
matrix:
webservice: [Gateway, Database, Processing]
configuration: [debug, release]
defaults:
run:
working-directory: ./${{ matrix.webservice }}
steps:
- uses: actions/checkout@v2
- uses: maxim-lobanov/setup-xcode@v1.2.3
with:
xcode-version: latest-stable
- uses: actions/cache@v2
with:
path: .build
key: ${{ runner.os }}-${{ matrix.webservice }}-spm-${{ hashFiles('**/Package.resolved') }}
- name: Check Xcode version
run: xcodebuild -version
- name: Check Swift version
run: swift --version
- name: Release Build
if: matrix.configuration == 'release'
run: swift build -c release
- name: Debug Build
if: matrix.configuration == 'debug'
run: swift build -c debug
linuxwebservices:
name: Linux ${{ matrix.webservice }} ${{ matrix.linux }} ${{ matrix.configuration }}
runs-on: ubuntu-latest
container:
image: swift:5.5-${{ matrix.linux }}
strategy:
fail-fast: false
matrix:
webservice: [Gateway, Database, Processing]
linux: [focal]
configuration: [debug, release, release_testing]
defaults:
run:
working-directory: ./${{ matrix.webservice }}
steps:
- uses: actions/checkout@v2
- name: Install libsqlite3
if: ${{ !(startsWith( matrix.linux, 'centos' ) || startsWith( matrix.linux, 'amazonlinux' )) }}
run: apt-get update && apt-get install -y --no-install-recommends libsqlite3-dev
- name: Install libsqlite3
if: startsWith( matrix.linux, 'amazonlinux' )
run: yum update -y && yum install -y sqlite-devel
- name: Install libsqlite3
if: startsWith( matrix.linux, 'centos' )
run: yum update -y --nobest && yum install -y sqlite-devel
- uses: actions/cache@v2
with:
path: .build
key: ${{ runner.os }}-${{matrix.linux}}-${{ matrix.webservice }}-spm-${{ hashFiles('Package.resolved') }}
- name: Check Swift version
run: swift --version
- name: Release Build
if: matrix.configuration == 'release'
run: swift build -c release
- name: Release Build & Test
if: matrix.configuration == 'release_testing'
run: swift test -c release -Xswiftc -enable-testing
- name: Debug Build & Test
if: matrix.configuration == 'debug'
run: swift test -c debug