-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
68 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,72 @@ | ||
name: Build and Compilation | ||
on: [push] | ||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
branches: [ master ] | ||
|
||
#=============================================================================# | ||
|
||
jobs: | ||
|
||
# Tests | ||
#=============================================================================# | ||
|
||
unit-test: | ||
timeout-minutes: 10 | ||
runs-on: ubuntu-latest | ||
needs: build | ||
env: | ||
DISPLAY: ":99" | ||
|
||
steps: | ||
- name: Clone repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install Dependencies | ||
run: | | ||
sudo apt-get update -qq | ||
sudo apt-get install -y -qq xorg-dev xvfb | ||
- name: Setup virtual screen | ||
run: Xvfb $DISPLAY -screen 0 1280x1024x24 & | ||
|
||
- name: Build MLX42 & tests | ||
run: cmake -DBUILD_TESTS=YES -B ${{github.workspace}}/build && cmake --build ${{github.workspace}}/build --parallel | ||
|
||
- name: Run tests | ||
run: ctest --output-on-failure --test-dir ${{github.workspace}}/build | ||
# Unix | ||
#=============================================================================# | ||
|
||
build: | ||
name: Build and Compilation | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: make | ||
run: make | ||
- name: make bonus | ||
run: make bonus | ||
name: Build and Compilation | ||
timeout-minutes: 10 | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, macos-latest, windows-latest] | ||
|
||
steps: | ||
- name: Clone repository | ||
uses: actions/checkout@v3 | ||
|
||
# Windows will just fetch glfw with cmake automatically. | ||
# This avoids doing extra work like installing a package manager. | ||
- name: Install Dependencies | ||
if: matrix.os != 'windows-latest' | ||
run: | | ||
set -x | ||
if [ "$RUNNER_OS" == "Linux" ]; then | ||
sudo apt-get update -qq | ||
sudo apt-get install -y -qq xorg-dev | ||
elif [ "$RUNNER_OS" == "macOS" ]; then | ||
brew update | ||
brew install glfw | ||
fi | ||
- name: Build | ||
run: cmake -B build && cmake --build build --parallel | ||
- name: make | ||
run: make | ||
- name: make bonus | ||
run: make bonus |