-
Notifications
You must be signed in to change notification settings - Fork 1
167 lines (144 loc) · 7.39 KB
/
continuous-integration.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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
name: Build with CMake
# Based on https://github.com/sudara/pamplejuce
on:
push:
# Ignore changes in documentation
paths-ignore:
- '**/LICENSE'
- '**.md'
- '**.svg'
- '**.png'
- '**.pdf'
- '**.code-workspace'
- '.clang-format'
- '.clang-tidy'
- '.gitignore'
- 'renovate.json'
env:
PROJECT_NAME: Speclet # Must match the JUCE project name from juce_add_plugin
BUILD_TYPE: Release
BUILD_DIR: Builds
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PLUGINVAL_VERSION: v1.0.3
DISPLAY: :0 # linux pluginval needs this
# jobs are run in parallel 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: [ubuntu-latest] # first test only with linux
os: [ubuntu-latest, windows-latest, macos-latest]
include:
- os: ubuntu-latest
artifact: Linux
- os: windows-latest
artifact: Windows
- os: macos-latest
artifact: MacOS
steps:
- name: Install JUCE's Linux Dependencies 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
# Added further dependencies from https://github.com/Tracktion/pluginval/blob/develop/.github/workflows/build.yaml
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
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get install -y freeglut3-dev g++ libcurl4-openssl-dev libjack-jackd2-dev libxcomposite-dev libxcursor-dev libxrandr-dev mesa-common-dev ladspa-sdk libgtk-3-dev
# Starting Virtual Frame Buffer X Server (Xvfb) as local display in the background
sudo /usr/bin/Xvfb $DISPLAY &
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
# This block can be removed once 15.1 is default
# JUCE requires it when building on macOS 14
- name: Use latest Xcode on system (macOS)
if: runner.os == 'macOS'
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable
- name: Get latest CMake
uses: lukka/get-cmake@latest
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: true # 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 .
- 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/${{env.PLUGINVAL_VERSION}}/pluginval_${{ matrix.artifact }}.zip" -o pluginval.zip
unzip pluginval
./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 Mac
working-directory: ${{ env.BUILD_DIR }}
if: matrix.artifact == 'MacOS'
run: |
curl -L "https://github.com/Tracktion/pluginval/releases/download/${{env.PLUGINVAL_VERSION}}/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/${{env.PLUGINVAL_VERSION}}/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: Remove shared lib before zip packaging
working-directory: ${{ env.BUILD_DIR }}/${{ env.PROJECT_NAME }}_artefacts/${{ env.BUILD_TYPE }}
run: |
cmake -E rm -f lib${{ env.PROJECT_NAME }}_SharedCode.a ${{ env.PROJECT_NAME }}_SharedCode.lib
- name: Rename folder to ${{ env.PROJECT_NAME }} before zip packaging
working-directory: ${{ env.BUILD_DIR }}/${{ env.PROJECT_NAME }}_artefacts
run: |
cmake -E rename ${{ env.BUILD_TYPE }} ${{ env.PROJECT_NAME }}-${{ matrix.artifact }}
- name: Zip
working-directory: ${{ env.BUILD_DIR }}/${{ env.PROJECT_NAME }}_artefacts
run: cmake -E tar cfv ${{ env.PROJECT_NAME }}-${{ matrix.artifact }}.zip --format=zip ${{ env.PROJECT_NAME }}-${{ matrix.artifact }}
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
path: ${{ env.BUILD_DIR }}/${{ env.PROJECT_NAME }}_artefacts/${{ env.PROJECT_NAME }}-${{ matrix.artifact }}.zip
name: ${{ env.PROJECT_NAME }}-${{ matrix.artifact }}
release:
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
needs: build_and_test
steps:
- name: Get the release version
id: get_release_version
run: echo ::set-output name=RELEASE_VERSION::${GITHUB_REF/refs\/tags\//}
- name: Download All Artifacts
id: download_artifacts
uses: actions/download-artifact@v4
- name: Add version name to the files that will be published
run: |
mv ${{ steps.download_artifacts.outputs.download-path }}/${{ env.PROJECT_NAME }}-Windows/${{ env.PROJECT_NAME }}-Windows.zip ./${{ env.PROJECT_NAME }}-${{ steps.get_release_version.outputs.RELEASE_VERSION }}-Windows.zip
mv ${{ steps.download_artifacts.outputs.download-path }}/${{ env.PROJECT_NAME }}-MacOS/${{ env.PROJECT_NAME }}-MacOS.zip ./${{ env.PROJECT_NAME }}-${{ steps.get_release_version.outputs.RELEASE_VERSION }}-MacOS.zip
mv ${{ steps.download_artifacts.outputs.download-path }}/${{ env.PROJECT_NAME }}-Linux/${{ env.PROJECT_NAME }}-Linux.zip ./${{ env.PROJECT_NAME }}-${{ steps.get_release_version.outputs.RELEASE_VERSION }}-Linux.zip
- name: Release
id: create_release
uses: softprops/action-gh-release@v2
with:
files: |
./${{ env.PROJECT_NAME }}-${{ steps.get_release_version.outputs.RELEASE_VERSION }}-Windows.zip
./${{ env.PROJECT_NAME }}-${{ steps.get_release_version.outputs.RELEASE_VERSION }}-Linux.zip
./${{ env.PROJECT_NAME }}-${{ steps.get_release_version.outputs.RELEASE_VERSION }}-MacOS.zip