88
99jobs :
1010 build :
11+ strategy :
12+ matrix :
13+ os : [ubuntu-latest, macos-latest]
14+ linkage : [dynamic, static]
15+
1116 # The CMake configure and build commands are platform agnostic and should work equally
1217 # well on Windows or Mac. You can convert this to a matrix build if you need
1318 # cross-platform coverage.
1419 # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
15- runs-on : ubuntu-latest
20+ runs-on : ${{matrix.os}}
1621
1722 steps :
1823 - uses : actions/checkout@v2
@@ -22,11 +27,22 @@ jobs:
2227 # We'll use this as our working directory for all subsequent commands
2328 run : cmake -E make_directory ${{github.workspace}}/build
2429
25- - name : Install dependencies
30+ - name : Install dependencies (Ubuntu)
31+ if : ${{matrix.os == 'ubuntu-latest'}}
2632 run : |
2733 sudo apt-get remove nginx libgd3
2834 sudo apt-get install libmad0-dev libid3tag0-dev libsndfile1-dev libgd-dev libboost-filesystem-dev libboost-program-options-dev libboost-regex-dev
2935
36+ - name : Install dependencies (MacOS)
37+ if : ${{matrix.os == 'macos-latest' && matrix.linkage == 'dynamic'}}
38+ run : |
39+ brew install mad libgd boost libpng zlib libsndfile libid3tag
40+
41+ - name : Install dependencies (MacOS)
42+ if : ${{matrix.os == 'macos-latest' && matrix.linkage == 'static'}}
43+ run : |
44+ brew install mad libgd boost libpng zlib
45+
3046 - name : Install Googletest
3147 shell : bash
3248 working-directory : ${{github.workspace}}
3551 tar xzf release-1.12.1.tar.gz
3652 ln -s googletest-release-1.12.1 googletest
3753
54+ - name : Install libsndfile
55+ if : ${{matrix.os == 'macos-latest' && matrix.linkage == 'static'}}
56+ run : |
57+ wget https://github.com/libsndfile/libsndfile/archive/refs/tags/1.1.0.tar.gz
58+ tar xzf 1.1.0.tar.gz
59+ cd libsndfile-1.1.0
60+ mkdir build
61+ cd build
62+ cmake -D ENABLE_MPEG=0 -D ENABLE_TESTING=0 -D BUILD_SHARED_LIBS=0 -D BUILD_REGTEST=0 -D BUILD_PROGRAMS=0 -D BUILD_TESTING=0 -D BUILD_EXAMPLES=0 ..
63+ make
64+ make install
65+
66+ - name : Install libid3tag
67+ if : ${{matrix.os == 'macos-latest' && matrix.linkage == 'static'}}
68+ run : |
69+ wget http://sourceforge.net/projects/mad/files/libid3tag/0.15.1b/libid3tag-0.15.1b.tar.gz
70+ tar xzf libid3tag-0.15.1b.tar.gz
71+ cd libid3tag-0.15.1b
72+ ./configure --enable-static
73+ make
74+ make install
75+
3876 - name : Configure CMake
3977 # Use a bash shell so we can use the same syntax for environment variable
4078 # access regardless of the host operating system
@@ -43,13 +81,15 @@ jobs:
4381 # Note the current convention is to use the -S and -B options here to specify source
4482 # and build directories, but this is only available with CMake 3.13 and higher.
4583 # The CMake binaries on the Github Actions machines are (as of this writing) 3.12
46- run : cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE =$BUILD_TYPE
84+ run : cmake $GITHUB_WORKSPACE -D CMAKE_BUILD_TYPE =$BUILD_TYPE -D BUILD_STATIC=${{matrix.linkage == 'static'}}
4785
4886 - name : Build
4987 working-directory : ${{github.workspace}}/build
5088 shell : bash
5189 # Execute the build. You can specify a specific target with "--target <NAME>"
52- run : cmake --build . --config $BUILD_TYPE
90+ run : |
91+ export LIBRARY_PATH=${LIBRARY_PATH}:/usr/local/opt/icu4c/lib
92+ cmake --build . --config $BUILD_TYPE
5393
5494 - name : Test
5595 working-directory : ${{github.workspace}}/build
0 commit comments