|
| 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 |
| 4 | + |
| 5 | +on: [push, pull_request] |
| 6 | + |
| 7 | +env: |
| 8 | + # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) |
| 9 | + BUILD_TYPE: Release |
| 10 | + |
| 11 | +jobs: |
| 12 | + build: |
| 13 | + # The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac. |
| 14 | + # You can convert this to a matrix build if you need cross-platform coverage. |
| 15 | + # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix |
| 16 | + runs-on: ubuntu-latest |
| 17 | + |
| 18 | + steps: |
| 19 | + - name: "Checkout" |
| 20 | + uses: actions/checkout@v4 |
| 21 | + with: |
| 22 | + fetch-depth: 0 |
| 23 | + |
| 24 | + - name: "Install dependencies" |
| 25 | + run: | |
| 26 | + sudo apt -y update |
| 27 | + sudo apt -y install libgtk-3-dev |
| 28 | +
|
| 29 | + - name: Configure CMake |
| 30 | + # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. |
| 31 | + # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type |
| 32 | + run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} |
| 33 | + |
| 34 | + - name: Build |
| 35 | + # Build your program with the given configuration |
| 36 | + run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} |
| 37 | + |
| 38 | + - name: Set Build number |
| 39 | + shell: bash |
| 40 | + run: echo "build_number=$(git rev-list HEAD --count)" >> $GITHUB_ENV |
| 41 | + |
| 42 | + - name: Compute git short sha |
| 43 | + shell: bash |
| 44 | + run: echo "git_short_sha=$(git rev-parse --short HEAD)" >> $GITHUB_ENV |
| 45 | + |
| 46 | + - name: Create artifacts |
| 47 | + shell: bash |
| 48 | + run: | |
| 49 | + mkdir artifacts |
| 50 | + cp build/pepv artifacts/ |
| 51 | + cp build/pepv.ui artifacts/ |
| 52 | + cp build/pepv.png artifacts/ |
| 53 | + |
| 54 | +
|
| 55 | + - name: Upload artifacts |
| 56 | + uses: actions/upload-artifact@v4 |
| 57 | + with: |
| 58 | + name: pepv-${{ env.build_number }}-${{ env.git_short_sha }} |
| 59 | + path: artifacts/ |
0 commit comments