Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: Reduce CI to unblock Github Action minutes #1217

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 61 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
name: "Build ${{ matrix.platform }} in ${{ matrix.build_type }}"
strategy:
matrix:
platform: [windows, ubuntu, macos]
platform: [windows, ubuntu]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any chance we can keep MacOS once merged?

Keep it in the matrix but add an if statement to the job to only run macos on main

Not sure what this would be in practice but something like

if !macos or ( macos and branch == main )

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could follow with a PR to add this if it becomes an issue

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any chance we can keep MacOS once merged?

I was thinking that, but wasn't sure what people would think, @tomadamatkinson could you make a seperate PR with how you would do it, I think you probably know what you want better, this PR was more of a "here is a way to improve things"

build_type: [Debug, Release]
env:
PARALLEL: -j 2
Expand Down Expand Up @@ -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/[email protected]
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:
Expand Down Expand Up @@ -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
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how this looks in practice

image

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could potentially move IOS to only run on main as well (see below for macos comment)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could potentially move IOS to only run on main as well (see below for macos comment)

Wouldn't that cause problems for PRs? How would people know if their changes would break iOS/Mac?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think changing from Debug to Release will help a lot of build times. Also just making sure we are not running it unless others are passing is huge... so ya, maybe worth just keeping it for now

name: "Build ios in ${{ matrix.build_type }}"
runs-on: macos-latest
strategy:
matrix:
build_type: [Debug]
build_type: [Release]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Release builds are about 3 times faster, this build is currently around 20+ minutes and should reduce it greatly


steps:
- uses: actions/checkout@v4
Expand Down
44 changes: 0 additions & 44 deletions .github/workflows/v2.yml

This file was deleted.

Loading