Skip to content

Commit

Permalink
CI: Unify linux pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
IonAgorria committed Oct 28, 2024
1 parent 60df22a commit cbb6dc7
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 44 deletions.
57 changes: 13 additions & 44 deletions .github/workflows/linux_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,23 @@ on:
- ready_for_review

env:
GH_CACHE_KEY: 3
GH_CACHE_KEY: 4

jobs:
build:
strategy:
fail-fast: false
matrix:
env: [
{build_type: Release, arch: x86_64, cmake: ""},
{build_type: Debug, arch: x86_64, cmake: ""},
{name: "Release", build_type: Release, arch: x86_64, upload: true, cmake: ""},
{name: "Debug", build_type: Debug, arch: x86_64, upload: true, cmake: ""},
{name: "Debug D3D9 + Sokol + Asserts", build_type: Debug, arch: x86_64, upload: false, cmake: "-DOPTION_D3D9=ON -DOPTION_SOKOL=ON -DOPTION_DEBUG_ASSERT=ON"},
{name: "Release D3D9 + Sokol", build_type: Release, arch: x86_64, upload: false, cmake: "-DOPTION_D3D9=ON -DOPTION_SOKOL=ON"},
{name: "Debug D3D9", build_type: Debug, arch: x86_64, upload: false, cmake: "-DOPTION_D3D9=ON -DOPTION_SOKOL=OFF"},
{name: "Debug Sokol", build_type: Debug, arch: x86_64, upload: false, cmake: "-DOPTION_D3D9=OFF -DOPTION_SOKOL=ON"},
{name: "Scripts Check", build_type: Release, arch: x86_64, upload: false, cmake: "-DOPTION_CHECK_SCRIPTS=ON "},
]
name: ${{matrix.env.build_type}} ${{matrix.env.arch}}
name: ${{matrix.env.name}} ${{matrix.env.arch}}
if: github.event.pull_request.draft != true
runs-on: ubuntu-latest
container:
Expand Down Expand Up @@ -55,6 +60,9 @@ jobs:
./docker/linux/prepare_sdl_pkgs
./docker/linux/prepare_sdl
if: steps.cache.outputs.cache-hit != 'true'
- name: Scripts check
run: export CUSTOM_TARGET="ScriptsCheck"
if: matrix.env.name == 'Scripts Check'
- name: build
run: |
chmod a+x ./docker/linux/builder
Expand All @@ -66,43 +74,4 @@ jobs:
with:
name: Perimeter ${{matrix.env.build_type}} ${{matrix.env.arch}}
path: ./build/docker-linux/output/Perimeter.tar
check_build:
strategy:
fail-fast: false
matrix:
env: [
{build_type: Release, arch: x86_64, name: "D3D9 + Sokol", cmake: "-DOPTION_D3D9=ON -DOPTION_SOKOL=ON"},
{build_type: Debug, arch: x86_64, name: "D3D9 + Sokol + Asserts", cmake: "-DOPTION_D3D9=ON -DOPTION_SOKOL=ON -DOPTION_DEBUG_ASSERT=ON"},
{build_type: Debug, arch: x86_64, name: "D3D9", cmake: "-DOPTION_D3D9=ON -DOPTION_SOKOL=OFF"},
{build_type: Debug, arch: x86_64, name: "Sokol", cmake: "-DOPTION_D3D9=OFF -DOPTION_SOKOL=ON"},
{build_type: Release, arch: x86_64, name: "Scripts Check", cmake: "-DOPTION_CHECK_SCRIPTS=ON "},
]
name: Check build ${{matrix.env.build_type}} ${{matrix.env.arch}} ${{matrix.env.name}}
if: github.event.pull_request.draft != true
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: update repos
run: sudo apt-get update
- name: install libs
run: sudo apt-get install cmake meson libsdl2-dev libsdl2-image-dev libsdl2-net-dev libsdl2-mixer-dev libboost-dev libavcodec-dev libavformat-dev libavfilter-dev libswscale-dev zlib1g-dev libvulkan-dev glslang-tools lld
- name: create build dir
run: mkdir build
- name: prepare boost
run: |
chmod a+x ./docker/prepare_boost
sudo ./docker/prepare_boost
- name: configure
run: cmake .. -G Ninja
-DCMAKE_BUILD_TYPE=${{matrix.env.build_type}}
-DOPTION_DEBUG_ASSERT=ON
${{matrix.env.cmake}}
working-directory: build
- name: Scripts check
run: ninja ScriptsCheck
working-directory: build
if: matrix.env.name == 'Scripts Check'
- name: build project
run: ninja
working-directory: build
if: matrix.env.name != 'Scripts Check'
if: matrix.env.upload
5 changes: 5 additions & 0 deletions docker/linux/builder
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ cmake -S $WORK_DIR -B $BUILD_DIR -G Ninja \
# Build dependencies
ninja dependencies

if [[ -n "$CUSTOM_TARGET" ]]; then
ninja $CUSTOM_TARGET;
exit 0;
fi

# Build project
ninja

Expand Down

0 comments on commit cbb6dc7

Please sign in to comment.