|
| 1 | +# This starter workflow is for a CMake project running on a single platform. There is a different starter workflow if you need cross-platform coverage. |
| 2 | +# See: https://github.com/actions/starter-workflows/blob/main/ci/cmake-multi-platform.yml |
| 3 | +name: Build on Linux |
| 4 | + |
| 5 | +on: |
| 6 | + push: |
| 7 | + branches: [ "devel", "master" ] |
| 8 | + pull_request: |
| 9 | + branches: [ "devel", "master" ] |
| 10 | + |
| 11 | +env: |
| 12 | + # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) |
| 13 | + BUILD_TYPE: RelWithDebInfo |
| 14 | + DRUMSTICKNAME: DrumstickV2 |
| 15 | + DRUMSTICK_LOCATION: ${{github.workspace}}/DrumstickV2 |
| 16 | + |
| 17 | +jobs: |
| 18 | + build: |
| 19 | + # The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac. |
| 20 | + # You can convert this to a matrix build if you need cross-platform coverage. |
| 21 | + # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix |
| 22 | + runs-on: ubuntu-latest |
| 23 | + |
| 24 | + steps: |
| 25 | + - uses: actions/checkout@v4 |
| 26 | + |
| 27 | + - uses: dawidd6/action-download-artifact@v3 |
| 28 | + with: |
| 29 | + name: ${{env.DRUMSTICKNAME}} |
| 30 | + github_token: ${{secrets.GH_PAT}} |
| 31 | + repo: pedrolcl/drumstick |
| 32 | + workflow: cmake.yml |
| 33 | + |
| 34 | + - name: Extract downloaded files |
| 35 | + run: tar xvf ${{env.DRUMSTICKNAME}}.tar |
| 36 | + |
| 37 | + - name: Install Qt |
| 38 | + uses: jurplel/install-qt-action@v3 |
| 39 | + with: |
| 40 | + version: '6.5.*' |
| 41 | + |
| 42 | + - name: Dependencies |
| 43 | + run: sudo apt-get update && sudo apt-get install -yq pkg-config libasound2-dev |
| 44 | + |
| 45 | + - name: Configure CMake |
| 46 | + # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. |
| 47 | + # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type |
| 48 | + run: cmake -B ${{github.workspace}}/build |
| 49 | + -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} |
| 50 | + -DCMAKE_PREFIX_PATH="${{env.DRUMSTICK_LOCATION}}" |
| 51 | + |
| 52 | + - name: Build |
| 53 | + # Build your program with the given configuration |
| 54 | + run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} |
0 commit comments