|
| 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: CMake on a single platform |
| 4 | + |
| 5 | +on: |
| 6 | + push: |
| 7 | + branches: [ "main" ] |
| 8 | + pull_request: |
| 9 | + branches: [ "main" ] |
| 10 | + |
| 11 | +env: |
| 12 | + # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) |
| 13 | + BUILD_TYPE: Release |
| 14 | + |
| 15 | +jobs: |
| 16 | + build: |
| 17 | + # The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac. |
| 18 | + # You can convert this to a matrix build if you need cross-platform coverage. |
| 19 | + # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix |
| 20 | + runs-on: ubuntu-latest |
| 21 | + |
| 22 | + steps: |
| 23 | + - uses: actions/checkout@v4 |
| 24 | + |
| 25 | + - name: Install LLVM |
| 26 | + run: wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && sudo ./llvm.sh 19 all |
| 27 | + |
| 28 | + - name: Make a symbolic link to lli-19 |
| 29 | + run: sudo ln -s /usr/bin/lli-19 /usr/bin/lli |
| 30 | + |
| 31 | + - name: Install Prerequisites |
| 32 | + run: sudo apt update && sudo apt install libboost1.74-all-dev default-jre libfmt-dev -y |
| 33 | + |
| 34 | + - name: Download ANTLR4.13.2 |
| 35 | + run: wget https://www.antlr.org/download/antlr-4.13.2-complete.jar -O ${{github.workspace}}/antlr-4.13.2-complete.jar && chmod +x ${{github.workspace}}/antlr-4.13.2-complete.jar |
| 36 | + |
| 37 | + - name: print java version |
| 38 | + run: java --version |
| 39 | + |
| 40 | + - name: Configure CMake |
| 41 | + # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. |
| 42 | + # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type |
| 43 | + run: export PATH="${{github.workspace}}:$PATH" && echo $PATH && cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} |
| 44 | + |
| 45 | + - name: Build |
| 46 | + # Build your program with the given configuration |
| 47 | + run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} |
| 48 | + |
| 49 | + - name: Test |
| 50 | + working-directory: ${{github.workspace}}/build |
| 51 | + # Execute tests defined by the CMake configuration. |
| 52 | + # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail |
| 53 | + run: ./ktest |
| 54 | + |
0 commit comments