|
| 1 | +name: Build and test |
| 2 | + |
| 3 | +on: |
| 4 | +- push |
| 5 | +- pull_request |
| 6 | + |
| 7 | +env: |
| 8 | + BUILD_TYPE: RelWithDebInfo |
| 9 | + |
| 10 | +jobs: |
| 11 | + Ubuntu: |
| 12 | + runs-on: ubuntu-latest |
| 13 | + |
| 14 | + steps: |
| 15 | + - uses: actions/checkout@v4 |
| 16 | + |
| 17 | + - name: Add OpenMW PPA Dependencies |
| 18 | + run: sudo add-apt-repository ppa:openmw/openmw; sudo apt-get update |
| 19 | + |
| 20 | + - name: Install Building Dependencies |
| 21 | + run: sudo CI/install_debian_deps.sh gcc openmw-deps openmw-deps-dynamic |
| 22 | + |
| 23 | + - name: Prime ccache |
| 24 | + uses: hendrikmuhs/ccache-action@v1 |
| 25 | + with: |
| 26 | + key: ${{ matrix.os }}-${{ env.BUILD_TYPE }} |
| 27 | + max-size: 1000M |
| 28 | + |
| 29 | + - name: Configure |
| 30 | + run: > |
| 31 | + cmake . |
| 32 | + -D CMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} |
| 33 | + -D OPENMW_USE_SYSTEM_RECASTNAVIGATION=ON |
| 34 | + -D USE_SYSTEM_TINYXML=ON |
| 35 | + -D BUILD_COMPONENTS_TESTS=ON |
| 36 | + -D BUILD_OPENMW_TESTS=ON |
| 37 | + -D BUILD_OPENCS_TESTS=ON |
| 38 | + -D CMAKE_INSTALL_PREFIX=install |
| 39 | +
|
| 40 | + - name: Build |
| 41 | + run: cmake --build . -- -j$(nproc) |
| 42 | + |
| 43 | + - name: Run components tests |
| 44 | + run: ./components-tests |
| 45 | + |
| 46 | + - name: Run OpenMW tests |
| 47 | + run: ./openmw-tests |
| 48 | + |
| 49 | + - name: Run OpenMW-CS tests |
| 50 | + run: ./openmw-cs-tests |
| 51 | + |
| 52 | + # - name: Install |
| 53 | + # shell: bash |
| 54 | + # run: cmake --install . |
| 55 | + |
| 56 | + # - name: Create Artifact |
| 57 | + # shell: bash |
| 58 | + # working-directory: install |
| 59 | + # run: | |
| 60 | + # ls -laR |
| 61 | + # 7z a ../build_artifact.7z . |
| 62 | + |
| 63 | + # - name: Upload Artifact |
| 64 | + # uses: actions/upload-artifact@v1 |
| 65 | + # with: |
| 66 | + # path: ./build_artifact.7z |
| 67 | + # name: build_artifact.7z |
| 68 | + |
| 69 | + MacOS: |
| 70 | + runs-on: macos-latest |
| 71 | + |
| 72 | + steps: |
| 73 | + - uses: actions/checkout@v4 |
| 74 | + |
| 75 | + - name: Install Building Dependencies |
| 76 | + run: CI/before_install.osx.sh |
| 77 | + |
| 78 | + - name: Prime ccache |
| 79 | + uses: hendrikmuhs/ccache-action@v1 |
| 80 | + with: |
| 81 | + key: ${{ matrix.os }}-${{ env.BUILD_TYPE }} |
| 82 | + max-size: 1000M |
| 83 | + |
| 84 | + - name: Configure |
| 85 | + run: CI/before_script.osx.sh |
| 86 | + - name: Build |
| 87 | + run: | |
| 88 | + cd build |
| 89 | + make -j $(sysctl -n hw.logicalcpu) package |
| 90 | +
|
| 91 | + Output-Envs: |
| 92 | + name: Read .env file and expose it as output |
| 93 | + runs-on: ubuntu-latest |
| 94 | + outputs: |
| 95 | + VCPKG_DEPS_TAG: ${{ env.VCPKG_DEPS_TAG }} |
| 96 | + BUILD_TYPE: ${{ env.BUILD_TYPE }} |
| 97 | + steps: |
| 98 | + - uses: actions/checkout@v4 |
| 99 | + - run: cat "${{ github.workspace }}/CI/github.env" >> $GITHUB_ENV |
| 100 | + |
| 101 | + Windows: |
| 102 | + needs: |
| 103 | + - Output-Envs |
| 104 | + |
| 105 | + strategy: |
| 106 | + fail-fast: true |
| 107 | + matrix: |
| 108 | + image: |
| 109 | + - "2019" |
| 110 | + - "2022" |
| 111 | + |
| 112 | + uses: ./.github/workflows/windows.yml |
| 113 | + with: |
| 114 | + image: ${{ matrix.image }} |
| 115 | + vcpkg-deps-tag: ${{ needs.Output-Envs.outputs.VCPKG_DEPS_TAG }} |
| 116 | + build-type: ${{ needs.Output-Envs.outputs.BUILD_TYPE }} |
0 commit comments