From c76d5415dedbdceff702e90c65101dbf9a2588a4 Mon Sep 17 00:00:00 2001 From: sjfricke Date: Mon, 4 Nov 2024 22:02:05 -0700 Subject: [PATCH] ci: Reduce CI to unblock Github Action minutes --- .github/workflows/build.yml | 63 +++++++++++++++++++++++++++++++++++-- .github/workflows/v2.yml | 44 -------------------------- 2 files changed, 61 insertions(+), 46 deletions(-) delete mode 100644 .github/workflows/v2.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 76ad81c0a..4dc047ebc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -15,7 +15,7 @@ jobs: name: "Build ${{ matrix.platform }} in ${{ matrix.build_type }}" strategy: matrix: - platform: [windows, ubuntu, macos] + platform: [windows, ubuntu] build_type: [Debug, Release] env: PARALLEL: -j 2 @@ -55,6 +55,63 @@ jobs: cmake -B"build/${{ matrix.platform }}" -DVKB_BUILD_TESTS=ON -DVKB_BUILD_SAMPLES=ON cmake --build "build/${{ matrix.platform }}" --target vulkan_samples --config ${{ matrix.build_type }} ${{ env.PARALLEL }} + build_v2: + name: "Build ${{ matrix.platform }} in ${{ matrix.build_type }}" + strategy: + matrix: + platform: [windows, ubuntu] + build_type: [Release] + env: + PARALLEL: -j 2 + runs-on: "${{ matrix.platform }}-latest" + steps: + - uses: actions/checkout@v4 + with: + submodules: "recursive" + + - if: ${{ matrix.platform == 'ubuntu' }} + name: Install RandR headers + run: | + sudo apt-get update + sudo apt install xorg-dev libglu1-mesa-dev + + - name: Configure + run: cmake -B"build/${{ matrix.platform }}" -DVKB_BUILD_TESTS=ON + + - name: "Build Components ${{ matrix.platform }} in ${{ matrix.build_type }}" + run: cmake --build "build/${{ matrix.platform }}" --target vkb__components --config ${{ matrix.build_type }} ${{ env.PARALLEL }} + + - name: "Build Tests ${{ matrix.platform }} in ${{ matrix.build_type }}" + run: cmake --build "build/${{ matrix.platform }}" --target vkb__tests --config ${{ matrix.build_type }} ${{ env.PARALLEL }} + + - name: "Run Tests ${{ matrix.platform }} in ${{ matrix.build_type }}" + run: ctest -C ${{ matrix.build_type }} --test-dir "build/${{ matrix.platform }}" --output-on-failure + + build_macos: + needs: build + name: "Build ${{ matrix.platform }} in ${{ matrix.build_type }}" + strategy: + # masoc is 10x expensive to run on GitHub machines, so only build simplest variations + matrix: + platform: [macos] + # Release builds are about 3 times faster than debug builds + build_type: [Release] + env: + PARALLEL: -j 2 + runs-on: "${{ matrix.platform }}-latest" + steps: + - uses: actions/checkout@v4 + with: + submodules: "recursive" + - name: ccache + uses: hendrikmuhs/ccache-action@v1.2.9 + with: + key: ${{ github.job }}-${{ matrix.os }} + - name: Configure and build + run: | + cmake -B"build/${{ matrix.platform }}" -DVKB_BUILD_TESTS=ON -DVKB_BUILD_SAMPLES=ON + cmake --build "build/${{ matrix.platform }}" --target vulkan_samples --config ${{ matrix.build_type }} ${{ env.PARALLEL }} + build_d2d: name: "Build Ubuntu with Direct To Display" env: @@ -108,11 +165,13 @@ jobs: run: NDK_CCACHE=1 NDK_CCACHE_BIN=ccache ./gradlew app:assemble${{ matrix.build_type }} --info build_ios: + # iOS is 10x expensive to run on GitHub machines, so only run if we know something else fast/simple passed as well + needs: build name: "Build ios in ${{ matrix.build_type }}" runs-on: macos-latest strategy: matrix: - build_type: [Debug] + build_type: [Release] steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/v2.yml b/.github/workflows/v2.yml deleted file mode 100644 index dc2f9bde9..000000000 --- a/.github/workflows/v2.yml +++ /dev/null @@ -1,44 +0,0 @@ -name: Build and Test v2 - -on: - pull_request: - types: [opened, synchronize, reopened] - push: - branches: [main] - -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} - cancel-in-progress: true - -jobs: - build: - name: "Build ${{ matrix.platform }} in ${{ matrix.build_type }}" - strategy: - matrix: - platform: [windows, ubuntu, macos] - build_type: [Debug, Release] - env: - PARALLEL: -j 2 - runs-on: "${{ matrix.platform }}-latest" - steps: - - uses: actions/checkout@v4 - with: - submodules: "recursive" - - - if: ${{ matrix.platform == 'ubuntu' }} - name: Install RandR headers - run: | - sudo apt-get update - sudo apt install xorg-dev libglu1-mesa-dev - - - name: Configure - run: cmake -B"build/${{ matrix.platform }}" -DVKB_BUILD_TESTS=ON - - - name: "Build Components ${{ matrix.platform }} in ${{ matrix.build_type }}" - run: cmake --build "build/${{ matrix.platform }}" --target vkb__components --config ${{ matrix.build_type }} ${{ env.PARALLEL }} - - - name: "Build Tests ${{ matrix.platform }} in ${{ matrix.build_type }}" - run: cmake --build "build/${{ matrix.platform }}" --target vkb__tests --config ${{ matrix.build_type }} ${{ env.PARALLEL }} - - - name: "Run Tests ${{ matrix.platform }} in ${{ matrix.build_type }}" - run: ctest -C ${{ matrix.build_type }} --test-dir "build/${{ matrix.platform }}" --output-on-failure