Skip to content

Commit

Permalink
Update build.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
RogerioLS authored Feb 1, 2024
1 parent 0440540 commit dc2d91c
Showing 1 changed file with 68 additions and 9 deletions.
77 changes: 68 additions & 9 deletions .github/workflows/build.yml
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

0 comments on commit dc2d91c

Please sign in to comment.