Skip to content

Commit

Permalink
Added barebones matrix build action for testing purposes
Browse files Browse the repository at this point in the history
  • Loading branch information
EduMenges committed Jul 2, 2024
1 parent f3b192f commit 3108e89
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 84 deletions.
91 changes: 50 additions & 41 deletions .github/workflows/test-build.yml
Original file line number Diff line number Diff line change
@@ -1,53 +1,62 @@
# This is a workflow to cache the sources for all the builds
name: Build per OS

name: Testing Build Matrix of Libraries

# Controls when the workflow will run
# Triggers the workflow on push or pull request events and manually from the Actions tab
on:
workflow_dispatch:

env:
GITHUB_TOKEN: ${{ github.token }}
MAKEFLAGS: "-j 8"
CMAKE_BUILD_PARALLEL_LEVEL: 8

jobs:
test-matrix-build:
runs-on: ubuntu-latest
# outputs:
# matrix: ${{ steps.set-matrix.outputs.matrix }}
# CACHE_NAME_SHAS: ${{ steps.set-matrix.outputs.CACHE_NAME_SHAS }}
# HAS_MATRIX_VALUES: ${{ steps.set-matrix.outputs.HAS_MATRIX_VALUES }}
build:
runs-on: ${{matrix.host}}
strategy:
fail-fast: false
matrix:
target: [Linux, Windows, OSX]
build_type: [Debug, Release]
include:
- target: Linux
host: ubuntu-latest
- target: Windows
host: windows-latest
- target: OSX
host: macos-latest
steps:
- name: Check out main third party without submodules
- name: Checkout
uses: actions/checkout@v4
with:
submodules: "recursive"

- name: Set clang as the default compiler
if: ${{ matrix.host == 'ubuntu-latest' }}
run: |
sudo update-alternatives --install /usr/bin/cc cc $(which clang) 100
sudo update-alternatives --install /usr/bin/c++ c++ $(which clang++) 100
sudo update-alternatives --set cc $(which clang)
sudo update-alternatives --set c++ $(which clang++)
- name: Install Linux dependencies
if: ${{ matrix.host == 'ubuntu-latest'}}
run: |
git clone -j 8 https://github.com/$GITHUB_REPOSITORY
cd thirdparty
git checkout $GITHUB_SHA
shell: bash
working-directory: ${{github.workspace}}
sudo apt install ccache -y
sudo apt install ninja-build -y
echo "CMAKE_GENERATOR=Ninja" >> $GITHUB_ENV
- name: Install gh cli extension actions-cache
- name: Install Windows dependencies
if: ${{ matrix.host == 'windows-latest'}}
run: |
type -p gh >/dev/null || {
type -p curl >/dev/null || sudo apt install curl -y
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg
sudo chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null
sudo apt update
sudo apt install gh -y
}
gh extension install actions/gh-actions-cache
echo "REPO=${{ github.repository }}" >> $GITHUB_ENV
echo "BRANCH=${{ github.ref }}" >> $GITHUB_ENV
echo "GH_TOKEN=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_ENV
- name: Check out submodules
choco install ccache -A
- name: Install Darwin dependencies
if: ${{ matrix.host == 'macos-latest'}}
run: |
cd thirdparty
time git submodule update --init --recursive --jobs 8
brew install ccache
- name: Install bindgen
run: cargo install cbindgen

- name: Add Rust target
run: rustup target add wasm32-unknown-emscripten

shell: bash
working-directory: ${{github.workspace}}
- name: Configure CMake
run: cmake -S build/${{matrix.target}} -B build/${{matrix.target}}/${{matrix.build_type}} -DCMAKE_BUILD_TYPE=${{matrix.build_type}}

- name: Build project
run: cmake --build build/${{matrix.target}}/${{matrix.build_type}} --config ${{matrix.build_type}}
43 changes: 0 additions & 43 deletions .github/workflows/test-cache.yml

This file was deleted.

0 comments on commit 3108e89

Please sign in to comment.