-
Notifications
You must be signed in to change notification settings - Fork 66
78 lines (61 loc) · 2.2 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# -----------------------------------------------------------------------------
# Codam Coding College, Amsterdam @ 2022-2023-2023 by W2Wizard.
# See README in the root project for more information.
# -----------------------------------------------------------------------------
name: Build
#=============================================================================#
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:
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
#=============================================================================#