-
Notifications
You must be signed in to change notification settings - Fork 0
75 lines (71 loc) · 2.5 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
#
# This source file is part of the FA 2021 open source project
#
# SPDX-FileCopyrightText: 2021 Paul Schmiedmayer and the FA 2021 project authors (see CONTRIBUTORS.md) <[email protected]>
#
# SPDX-License-Identifier: MIT
#
name: Build and Test
on:
push:
branches:
- develop
pull_request:
branches:
- develop
workflow_dispatch:
jobs:
macos:
name: macOS ${{ matrix.configuration }}
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
configuration: [debug, release]
steps:
- uses: actions/checkout@v2
- uses: maxim-lobanov/[email protected]
with:
xcode-version: latest
- uses: actions/cache@v2
with:
path: .build
key: ${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}
- name: Check Xcode version
run: xcodebuild -version
- name: Check Swift version
run: swift --version
- name: Build ${{ matrix.configuration }}
run: swift build -c ${{ matrix.configuration }}
linux:
name: Linux ${{ matrix.linux }} ${{ matrix.configuration }}
container:
image: swiftlang/swift:nightly-5.5-${{ matrix.linux }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
linux: [focal, amazonlinux2, centos8]
configuration: [debug, release]
steps:
- uses: actions/checkout@v2
- name: Install libsqlite3, lsof, zsh and libavahi-compat-libdnssd-dev
if: ${{ !(startsWith( matrix.linux, 'centos' ) || startsWith( matrix.linux, 'amazonlinux' )) }}
run: apt-get update && apt-get install -y --no-install-recommends libsqlite3-dev lsof zsh libavahi-compat-libdnssd-dev
- name: Install libsqlite3 and avahi
if: startsWith( matrix.linux, 'amazonlinux' )
run: yum update -y && yum install -y sqlite-devel avahi avahi-compat-libdns_sd avahi-compat-libdns_sd-devel
- name: Install libsqlite3
if: startsWith( matrix.linux, 'centos' )
run: yum update -y --nobest && yum install -y sqlite-devel
- name: Install avahi
if: startsWith( matrix.linux, 'centos' )
run: dnf update -y && dnf --enablerepo=powertools -y install avahi-compat-libdns_sd avahi-compat-libdns_sd-devel
- uses: actions/cache@v2
with:
path: .build
key: ${{ runner.os }}-${{matrix.linux}}-${{matrix.configuration}}-spm2-${{ hashFiles('Package.resolved') }}
- name: Check Swift version
run: swift --version
- name: Build ${{ matrix.configuration }}
run: swift build -c ${{ matrix.configuration }}