-
Notifications
You must be signed in to change notification settings - Fork 310
131 lines (100 loc) · 8.19 KB
/
main.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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
# Workflow for building Psychtoolbox mex files for Matlab/Octave on Ubuntu Linux 20.04-LTS.
# Currently builds all mex files except Datapixx, due to lack of SDK availability in VM.
#
# Note: - Free GitHub runners are only available for public / OSS repositories.
# - The free Matlab runner is only available for Linux.
#
# Copyright (c) 2022-2023 by Mario Kleiner, licensed under MIT license.
#
name: CI
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the master branch
#push:
# branches: [ master ]
#pull_request:
# branches: [ master ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# Run a job to build the majority of the mex files targetting Ubuntu 20.04-LTS and later, simply called "build"
build:
name: Run commands to build+upload Matlab+Octave mex files for 64-Bit Ubuntu Linux 20.04-LTS on Intel.
# The type of runner that the job will run on: Fixed to Ubuntu 20.04-LTS
runs-on: ubuntu-20.04
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Check out Psychtoolbox repository to runner.
uses: actions/checkout@v3
- name: Add SR-Research Eyelink repositories.
run: sudo apt-key adv --fetch-keys https://apt.sr-research.com/SRResearch_key ; sudo add-apt-repository 'deb [arch=amd64] https://apt.sr-research.com SRResearch main'
- name: Setup additional build and runtime dependencies of Psychtoolbox.
run: sudo apt update ; sudo apt install -y octave-psychtoolbox-3 liboctave-dev libfontconfig1-dev libopenhmd-dev libusb-1.0-0-dev xorg-dev libx11-xcb-dev libxcb*-dev libglu1-mesa-dev freeglut3-dev libgstreamer*-dev libasound2-dev portaudio19-dev libfreenect-dev libopenal-dev libapriltag-dev ; sudo apt remove -y libgamemode0; sudo apt install -y libdc1394-dev
- name: Setup OculusVR SDK 0.5 for 64-Bit Linux.
run: tar xvf PsychSourceGL/Cohorts/OculusSDK/ovr_sdk_linux_0.5.0.1.tar.xz; cd ovr_sdk_linux_0.5.0.1 ; sudo cp --recursive LibOVR/Include/* /usr/local/include/ ; sudo cp ../PsychSourceGL/Cohorts/OculusSDK/libOVR.a /usr/local/lib/
- name: Setup OpenXR SDK and OpenXR loader for PsychOpenXRCore build, backported for 64-Bit Ubuntu Linux 20.04.
run: sudo add-apt-repository ppa:monado-xr/monado; sudo apt-get update; sudo apt install -y libopenxr-dev;
- name: Setup latest Vulkan SDK from LunarG for PsychVulkanCore build, as Ubuntu 20.04 SDK is too old for all our needs.
run: wget -qO - https://packages.lunarg.com/lunarg-signing-key-pub.asc | sudo apt-key add - ; sudo wget -qO /etc/apt/sources.list.d/lunarg-vulkan-1.3.243-focal.list https://packages.lunarg.com/vulkan/1.3.243/lunarg-vulkan-1.3.243-focal.list ; sudo apt update ; sudo apt install -y vulkan-sdk ;
- name: Install minimal SR-Research Eyelink SDK for building Eyelink mex files.
run: sudo apt install eyelinkcore
- name: Set up latest MATLAB
uses: matlab-actions/setup-matlab@v1
- name: Build all eligible Psychtoolbox Matlab mex files.
uses: matlab-actions/run-command@v1
with:
command: cd('Psychtoolbox'); pwd, addpath(genpath(pwd)); cd('../PsychSourceGL/Source'); pwd, linuxmakeit64(-1, 1);
- name: Build all eligible Psychtoolbox Octave mex files.
run: octave --eval "warning('off', 'Octave:shadowed-function'); cd('Psychtoolbox'); pwd, addpath(genpath(pwd)); cd('../PsychSourceGL/Source'); pwd, linuxmakeitoctave3(-1, 1); linuxmakeitoctave3(12, 0); linuxmakeitoctave3(4, 0); cd('../Cohorts/FTGLTextRenderer'); makeftglplugin;"
- name: Archive built 64-Bit Matlab and Octave mex files for 64-Bit Intel
uses: actions/upload-artifact@v3
with:
name: Linux64BitIntelMexFiles
path: |
Psychtoolbox/PsychBasic/Octave5LinuxFiles64/*.mex
Psychtoolbox/PsychBasic/*.mexa64
Psychtoolbox/PsychBasic/PsychPlugins/libptbdrawtext_ftgl64.so.1
- name: Use xvfb for basic testing of Psychtoolbox under Octave. Rendering tests under llvmpipe, some basic queries.
run: xvfb-run octave --eval "warning('off', 'Octave:shadowed-function'); cd('Psychtoolbox'); pwd, addpath(genpath(pwd)); addpath(genpath([pwd '/PsychBasic/Octave5LinuxFiles64'])); PsychDebugWindowConfiguration; Screen('Preference', 'ConserveVRAM', 4194304); [a,b,c] = GetKeyboardIndices, [d,e,f] = GetMouseIndices"
# Run a job called "buildforubuntu22.04", only for some few mex files which are targetted at only easily running on Ubuntu 22.04 and later:
buildforubuntu22-04:
name: Run commands to build+upload some Matlab+Octave mex files for 64-Bit Ubuntu Linux 22.04-LTS on Intel.
# The type of runner that the job will run on: Fixed to Ubuntu 22.04-LTS
runs-on: ubuntu-22.04
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Check out Psychtoolbox repository to runner.
uses: actions/checkout@v3
# - name: Add SR-Research Eyelink repositories.
# run: sudo apt-key adv --fetch-keys https://apt.sr-research.com/SRResearch_key ; sudo add-apt-repository 'deb [arch=amd64] https://apt.sr-research.com SRResearch main'
- name: Setup additional build and runtime dependencies of Psychtoolbox. Currently only libapriltag
run: sudo apt update ; sudo apt install -y octave-psychtoolbox-3 liboctave-dev freeglut3-dev libapriltag-dev
# - name: Setup OculusVR SDK 0.5 for 64-Bit Linux.
# run: tar xvf PsychSourceGL/Cohorts/OculusSDK/ovr_sdk_linux_0.5.0.1.tar.xz; cd ovr_sdk_linux_0.5.0.1 ; sudo cp --recursive LibOVR/Include/* /usr/local/include/ ; sudo cp ../PsychSourceGL/Cohorts/OculusSDK/libOVR.a /usr/local/lib/
# - name: Setup OpenXR SDK and OpenXR loader for PsychOpenXRCore build, backported for 64-Bit Ubuntu Linux 20.04.
# run: sudo add-apt-repository ppa:monado-xr/monado; sudo apt-get update; sudo apt install -y libopenxr-dev;
# - name: Setup latest Vulkan SDK from LunarG for PsychVulkanCore build, as Ubuntu 20.04 SDK is too old for all our needs.
# run: wget -qO - https://packages.lunarg.com/lunarg-signing-key-pub.asc | sudo apt-key add - ; sudo wget -qO /etc/apt/sources.list.d/lunarg-vulkan-1.3.243-focal.list https://packages.lunarg.com/vulkan/1.3.243/lunarg-vulkan-1.3.243-focal.list ; sudo apt update ; sudo apt install -y vulkan-sdk ;
# - name: Install minimal SR-Research Eyelink SDK for building Eyelink mex files.
# run: sudo apt install eyelinkcore
- name: Set up latest MATLAB
uses: matlab-actions/setup-matlab@v1
- name: Build all eligible Psychtoolbox Matlab mex files. Currently only PsychCV
uses: matlab-actions/run-command@v1
with:
command: cd('Psychtoolbox'); pwd, addpath(genpath(pwd)); cd('../PsychSourceGL/Source'); pwd, linuxmakeit64(10, 1);
- name: Build all eligible Psychtoolbox Octave mex files. Currently only PsychCV
run: octave --eval "warning('off', 'Octave:shadowed-function'); cd('Psychtoolbox'); pwd, addpath(genpath(pwd)); cd('../PsychSourceGL/Source'); linuxmakeitoctave3(10, 1);"
- name: Archive built 64-Bit Matlab and Octave mex files for 64-Bit Intel on Ubuntu 22.04
uses: actions/upload-artifact@v3
with:
name: Linux64BitIntelMexFilesForUbuntu22.04
path: |
Psychtoolbox/PsychBasic/Octave5LinuxFiles64/*.mex
Psychtoolbox/PsychBasic/*.mexa64
# Psychtoolbox/PsychBasic/PsychPlugins/libptbdrawtext_ftgl64.so.1
# - name: Use xvfb for basic testing of Psychtoolbox under Octave. Rendering tests under llvmpipe, some basic queries.
# run: xvfb-run octave --eval "warning('off', 'Octave:shadowed-function'); cd('Psychtoolbox'); pwd, addpath(genpath(pwd)); addpath(genpath([pwd '/PsychBasic/Octave5LinuxFiles64'])); PsychDebugWindowConfiguration; Screen('Preference', 'ConserveVRAM', 4194304); [a,b,c] = GetKeyboardIndices, [d,e,f] = GetMouseIndices"