-
-
Notifications
You must be signed in to change notification settings - Fork 9
91 lines (89 loc) · 2.91 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
name: build & test
on:
push:
branches:
- master
- dev
pull_request:
jobs:
prebuild:
runs-on: ubuntu-latest
outputs:
lastmessage: ${{ steps.checkmessage.outputs.lastmessage }}
steps:
- name : GITHUB CONTEXT
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
- if: contains(github.event_name, 'pull_request')
uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}
- if: "!contains(github.event_name, 'pull_request')"
uses: actions/checkout@v2
- id: checkmessage
run: |
git log --no-merges -1 --oneline
echo "::set-output name=lastmessage::$(git log --no-merges -1 --oneline)"
build:
needs: prebuild
if: "!contains( needs.prebuild.outputs.lastmessage , '[skip ci]')"
runs-on: ${{ matrix.os }}
timeout-minutes: 120
strategy:
fail-fast: false
matrix:
os:
- ubuntu-20.04
- macos-10.15
- macos-10.14
- windows-latest
config:
- Release
include:
- os: ubuntu-20.04
cxx: /usr/bin/g++-9
shell: bash
cmake_args: -DBUILD_SHARED_LIBS=OFF
- os: macos-10.15
cxx: /usr/bin/clang++
shell: bash
cmake_args: -DBUILD_SHARED_LIBS=ON
- os: macos-10.14
cxx: /usr/bin/clang++
shell: bash
cmake_args: -DBUILD_SHARED_LIBS=ON
- os: windows-latest
cxx: g++
shell: msys2 {0}
cmake_args: -DBUILD_SHARED_LIBS=OFF
defaults:
run:
shell: ${{ matrix.shell }}
env:
CXX: ${{matrix.cxx}}
steps:
- if: contains(matrix.os, 'windows')
uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
install: git flex bison mingw-w64-x86_64-cmake mingw-w64-x86_64-gcc mingw64/mingw-w64-x86_64-libsndfile mingw64/mingw-w64-x86_64-opus mingw-w64-x86_64-ninja mingw-w64-x86_64-llvm
- if: contains(matrix.os, 'macos')
run: |
brew install flex bison libsndfile llvm ninja
- if: contains(matrix.os, 'ubuntu')
run: |
wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && sudo ./llvm.sh 11
sudo apt-get install libalsa-ocaml-dev libfl-dev libbison-dev libz-dev libvorbis-dev libsndfile-dev libopus-dev gcc-9 ninja-build
- uses: actions/checkout@v2
with:
submodules: "recursive"
- name: configure
run:
cmake . -Bbuild -G Ninja -DCMAKE_BUILD_TYPE=${{ matrix.config }} -DBUILD_TEST=ON ${{ matrix.cmake_args }}
- name: build
run: cmake --build build -j --config ${{ matrix.config }}
- if: contains(matrix.os, 'macos')
# currently only on macos
name: test
run: cd build && ctest --verbose