Skip to content

MATLAB Build

MATLAB Build #132

Workflow file for this run

# This is a basic workflow to help you get started with MATLAB Actions
name: MATLAB Build
# Controls when the action will run.
on:
push: # Runs on push events
pull_request: # Runs on pull requests
workflow_dispatch: # Allows you to run this workflow manually from the Actions tab
schedule:
- cron: '49/61 22/25 * * *' # schedule a daily-ish build
jobs:
# This workflow contains a single job called "build"
compile-and-test:
strategy:
matrix:
platform: [ubuntu-latest, windows-latest, macos-latest]
# The type of runner that the job will run on
runs-on: ${{ matrix.platform }}
# 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
- uses: actions/checkout@v3
- name: Cache MATLAB
id: cache-matlab
uses: actions/cache@v3
with:
path: ${{ runner.tool_cache }}/MATLAB
key: R2022b-${{ matrix.platform }}
# Sets up MATLAB on the GitHub Actions runner
- name: Setup MATLAB
uses: matlab-actions/setup-matlab@v2-beta
with:
release: R2022b
# Runs a set of commands using the runners shell
- name: Generate mex files & run tests
uses: matlab-actions/run-build@v1
with:
tasks: test
- name: Upload Mex Files
if: ${{ always() }}
uses: actions/upload-artifact@v3
with:
# Artifact name
name: Mex-Artifacts-${{ matrix.platform }}
# A file, directory or wildcard pattern that describes what to upload
path: toolbox/**/*.mex*64
create-R2022b-toolbox:
needs: compile-and-test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Start display server
run: |
sudo apt-get install xvfb
Xvfb :99 &
echo "DISPLAY=:99" >> $GITHUB_ENV
- name: Cache MATLAB
id: cache-matlab
uses: actions/cache@v3
with:
path: ${{ runner.tool_cache }}/MATLAB
key: R2022b-ubuntu-latest
# Sets up MATLAB on the GitHub Actions runner
- name: Setup MATLAB
uses: matlab-actions/setup-matlab@v2-beta
with:
release: R2022b
- name: Download mac artifacts
uses: actions/download-artifact@v3
with:
name: Mex-Artifacts-macos-latest
path: toolbox
- name: Download windows artifacts
uses: actions/download-artifact@v3
with:
name: Mex-Artifacts-windows-latest
path: toolbox
- name: Download linux artifacts
uses: actions/download-artifact@v3
with:
name: Mex-Artifacts-ubuntu-latest
path: toolbox
# Runs a set of commands using the runners shell
- name: Run toolbox build
uses: matlab-actions/run-build@v1
with:
tasks: toolbox
- name: Upload cross platform toolbox
uses: actions/upload-artifact@v3
with:
# Artifact name
name: Cross Platform Toolbox File
# A file, directory or wildcard pattern that describes what to upload
path: ./**/*.mltbx
canary-tests:
strategy:
matrix:
platform: [ubuntu-latest, windows-latest, macos-latest]
# The type of runner that the job will run on
runs-on: ${{ matrix.platform }}
# 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
- uses: actions/checkout@v3
# Sets up MATLAB on the GitHub Actions runner
- name: Setup MATLAB
uses: matlab-actions/setup-matlab@v2-beta
# Runs a set of commands using the runners shell
- name: Generate mex files & run tests
uses: matlab-actions/run-build@v1
with:
tasks: test