generated from sudara/pamplejuce
-
Notifications
You must be signed in to change notification settings - Fork 0
148 lines (127 loc) · 5.8 KB
/
cmake_ctest.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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
name: CMake
on: [push]
env:
PROJECT_NAME: Pamplejuce # Must match the JUCE project name from juce_add_plugin
BUILD_TYPE: Release
BUILD_DIR: Builds
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DISPLAY: :0 # linux pluginval needs this
# jobs are run in paralell on different machines
# all steps run in series
jobs:
build_and_test:
name: ${{ matrix.artifact }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false # show all errors for each platform (vs. cancel jobs on error)
matrix:
os: [windows-latest, ubuntu-latest, macos-11.0]
include:
- os: windows-latest
artifact: Windows
- os: ubuntu-latest
artifact: Linux
- os: macos-11.0 # TODO: change once macos-latest catches up
artifact: MacOS
steps:
- name: Install JUCE's Linux Deps and select g++ 10
if: runner.os == 'Linux'
# Thanks to McMartin & co https://forum.juce.com/t/list-of-juce-dependencies-under-linux/15121/44
run: |
sudo apt-get update && sudo apt install libasound2-dev libx11-dev libxinerama-dev libxext-dev libfreetype6-dev libwebkit2gtk-4.0-dev libglu1-mesa-dev ccache xvfb fluxbox
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 10
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-10 10
- name: Get latest CMake
uses: lukka/get-cmake@latest
- name: Checkout code
uses: actions/checkout@v2
with:
submodules: recursive # Gotta get JUCE populated
- name: ccache
if: matrix.os != 'windows-latest'
uses: hendrikmuhs/ccache-action@v1
with:
key: ${{ matrix.os }}-${{ matrix.type }}
- name: Configure
shell: bash
run: cmake -B ${{ env.BUILD_DIR }} -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE}} -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" .
- name: Build
shell: bash
run: cmake --build ${{ env.BUILD_DIR }} --config ${{ env.BUILD_TYPE }}
- name: Test
working-directory: ${{ env.BUILD_DIR }}
run: ctest
# - name: Pluginval Linux
# working-directory: ${{ env.BUILD_DIR }}
# if: matrix.artifact == 'Linux'
# run: |
# curl -L "https://github.com/Tracktion/pluginval/releases/download/v0.3.0/pluginval_${{ matrix.artifact }}.zip" -o pluginval.zip
# unzip pluginval
# start xvfb in the background
# sudo /usr/bin/Xvfb $DISPLAY &
# sleep 0.5 # let Xvfb start up
# we'll also need a window manager for JUCE to be happy
# fluxbox &
# ./pluginval --strictness-level 10 --validate-in-process --verbose --validate "${{ env.PROJECT_NAME }}_artefacts/${{ env.BUILD_TYPE }}/VST3/${{ env.PROJECT_NAME }}.vst3"
- name: Pluginval Mac
working-directory: ${{ env.BUILD_DIR }}
if: matrix.artifact == 'MacOS'
run: |
curl -L "https://github.com/Tracktion/pluginval/releases/download/v0.3.0/pluginval_${{ matrix.artifact }}.zip" -o pluginval.zip
unzip pluginval
pluginval.app/Contents/MacOS/pluginval --strictness-level 10 --validate-in-process --verbose --output-dir "." --validate "${{ env.PROJECT_NAME }}_artefacts/${{ env.BUILD_TYPE }}/VST3/${{ env.PROJECT_NAME }}.vst3"
- name: Pluginval Windows
shell: cmd
working-directory: ${{ env.BUILD_DIR }}
if: matrix.artifact == 'Windows'
run: |
powershell -Command "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; Invoke-WebRequest https://github.com/Tracktion/pluginval/releases/download/v0.3.0/pluginval_Windows.zip -OutFile pluginval.zip"
powershell -Command "Expand-Archive pluginval.zip -DestinationPath ."
pluginval.exe --strictness-level 10 --validate-in-process --output-dir "./bin" --validate "${{ env.PROJECT_NAME }}_artefacts/${{ env.BUILD_TYPE }}/VST3/${{ env.PROJECT_NAME }}.vst3"
if %ERRORLEVEL% neq 0 { exit /b 1 }
- name: Zip
working-directory: ${{ env.BUILD_DIR }}
run: cmake -E tar cfv ${{ env.PROJECT_NAME }}-${{ matrix.artifact }}.zip --format=zip ${{ env.PROJECT_NAME }}_artefacts
- name: Upload Artifact
uses: actions/upload-artifact@v2
with:
path: ${{ env.BUILD_DIR }}/${{ env.PROJECT_NAME }}-${{ matrix.artifact }}.zip
name: ${{ env.PROJECT_NAME }}-${{ matrix.artifact }}
release:
if: contains(github.ref, 'tags/v')
runs-on: ubuntu-latest
needs: build_and_test
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
steps:
- name: Create Release
id: create_release
uses: actions/create-release@v1
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
- name: Download All Artifacts
uses: actions/download-artifact@v2
# - name: Upload Windows Asset
# uses: actions/upload-release-asset@v1
# with:
# upload_url: ${{ steps.create_release.outputs.upload_url }}
# asset_path: ./${{ env.PROJECT_NAME }}-Windows.zip
# asset_name: ${{ env.PROJECT_NAME }}-Windows.zip
# asset_content_type: application/zip
# - name: Upload Linux Asset
# uses: actions/upload-release-asset@v1
# with:
# upload_url: ${{ steps.create_release.outputs.upload_url }}
# asset_path: ./${{ env.PROJECT_NAME }}-Linux.zip
# asset_name: ${{ env.PROJECT_NAME }}-Linux.zip
# asset_content_type: application/zip
# - name: Upload MacOS Asset
# uses: actions/upload-release-asset@v1
# with:
# upload_url: ${{ steps.create_release.outputs.upload_url }}
# asset_path: ./${{ env.PROJECT_NAME }}-MacOS.zip
# asset_name: ${{ env.PROJECT_NAME }}-MacOS.zip
# asset_content_type: application/zip