ci: only run at base directory

we don't have to build almost the same thing twice
This commit is contained in:
Ali Chraghi 2022-09-20 10:32:09 +04:30 committed by Stephen Gutekanst
parent 1a6a82e11b
commit 18ad648e68

View file

@ -5,9 +5,6 @@ on:
jobs:
x86_64-linux:
runs-on: ubuntu-latest
strategy:
matrix:
project: ['.', 'libs/glfw', 'libs/freetype']
# We want to run on external PRs, but not on our own internal PRs as they'll be run by the push
# to the branch.
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
@ -22,32 +19,29 @@ jobs:
sudo sh -c 'wget -c https://ziglang.org/builds/zig-linux-x86_64-0.10.0-dev.4060+61aaef0b0.tar.xz -O - | tar -xJ --strip-components=1 -C /usr/local/bin'
# - name: x86_64-linux -> x86_64-linux-musl
# if: matrix.project == 'libs/freetype' || matrix.project == 'libs/glfw'
# run: cd ${{ matrix.project }} && zig build -Dtarget=x86_64-linux-musl
# run: zig build -Dtarget=x86_64-linux-musl
- name: x86_64-linux -> x86_64-macos
run: cd ${{ matrix.project }} && zig build -Dtarget=x86_64-macos.12-none
run: zig build -Dtarget=x86_64-macos.12-none
env:
AGREE: true
- name: x86_64-linux -> aarch64-macos
run: cd ${{ matrix.project }} && zig build -Dtarget=aarch64-macos.12-none
run: zig build -Dtarget=aarch64-macos.12-none
env:
AGREE: true
- name: x86_64-linux -> x86_64-windows
run: cd ${{ matrix.project }} && zig build -Dtarget=x86_64-windows-gnu
run: zig build -Dtarget=x86_64-windows-gnu
- name: compile all examples
if: matrix.project == '.'
run: cd ${{ matrix.project }} && zig build compile-all -Dtarget=x86_64-linux-gnu
run: zig build compile-all -Dtarget=x86_64-linux-gnu
- name: compile all examples (WASM)
if: matrix.project == '.'
run: cd ${{ matrix.project }} && zig build compile-all -Dtarget=wasm32-freestanding-none
run: zig build compile-all -Dtarget=wasm32-freestanding-none
- name: launch xvfb
run: Xvfb :99 -screen 0 1680x720x24 > /dev/null 2>&1 &
- name: test
if: matrix.project == '.'
run: |
sudo add-apt-repository -y ppa:kisak/kisak-mesa
sudo apt-get update
sudo apt-get install mesa-utils mesa-utils-extra mesa-va-drivers mesa-vdpau-drivers mesa-vulkan-drivers xvfb
cd ${{ matrix.project }} && zig build test
zig build test
x86_64-windows:
runs-on: windows-latest
# We want to run on external PRs, but not on our own internal PRs as they'll be run by the push