MATLAB Build #247
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
# 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 4/6 * *' # schedule a weekly-ish build | |
env: | |
MATHWORKS_LICENSING_ENDPOINT: dev | |
jobs: | |
# This workflow contains a single job called "build" | |
compile-and-test: | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
# The type of runner that the job will run on | |
runs-on: ${{ matrix.os }} | |
# 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-rc0 | |
with: | |
release: R2022b | |
cache: true | |
# Runs a set of commands using the runners shell | |
- name: Generate mex files & run tests | |
uses: matlab-actions/run-build@v2-rc0 | |
with: | |
tasks: test | |
- name: Upload Mex Files | |
if: ${{ always() }} | |
uses: actions/upload-artifact@v3 | |
with: | |
# Artifact name | |
name: Mex-Artifacts-${{ matrix.os }} | |
# A file, directory or wildcard pattern that describes what to upload | |
path: toolbox/**/*.mex*64 | |
- name: Upload Build traces on linux | |
if: matrix.os == 'ubuntu-latest' | |
uses: actions/upload-artifact@v3 | |
with: | |
# Artifact name | |
name: build-traces | |
# A file, directory or wildcard pattern that describes what to upload | |
path: .buildtool | |
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 | |
# Sets up MATLAB on the GitHub Actions runner | |
- name: Setup MATLAB | |
uses: matlab-actions/setup-matlab@v2-rc0 | |
with: | |
release: R2022b | |
cache: true | |
- 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 | |
# - name: Download build traces | |
# uses: actions/download-artifact@v3 | |
# with: | |
# name: build-traces | |
# path: . | |
# Runs a set of commands using the runners shell | |
- name: Run toolbox build | |
uses: matlab-actions/run-build@v2-rc0 | |
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: | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
# The type of runner that the job will run on | |
runs-on: ${{ matrix.os }} | |
# 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-rc0 | |
with: | |
release: latest | |
# Runs a set of commands using the runners shell | |
- name: Generate mex files & run tests | |
uses: matlab-actions/run-build@v2-rc0 | |
with: | |
tasks: test |