Skip to content

Add compatibility with MATLAB R2022b #246

Add compatibility with MATLAB R2022b

Add compatibility with MATLAB R2022b #246

Workflow file for this run

name: CI
env:
MATLAB_VER: R2023b
# 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" ]
paths-ignore:
- 'README.md'
- '.github/workflows/release.yml'
pull_request:
branches: [ "master" ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Allows you to run this workflow calling it from another workflow
workflow_call:
secrets:
REPO_READ_TOKEN:
required: true
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
check:
runs-on: matlab
# 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 repo
uses: actions/checkout@v3
with:
submodules: 'recursive'
token: ${{ secrets.REPO_READ_TOKEN }}
- name: Cache MATLAB build files
uses: actions/cache@v3
with:
key: matlab-buildtool
path: |
buildUtilities/.buildtool
- name: Run MATLAB command
run: |
&"$env:ProgramFiles\MATLAB\$env:MATLAB_VER\bin\matlab.exe" -batch "openProject(pwd); cd('buildUtilities'); buildtool check"
- name: Upload SARIF file
uses: github/codeql-action/upload-sarif@v2
with:
# Path to SARIF file relative to the root of the repository
sarif_file: buildUtilities/results.sarif
# Optional category for the results
# Used to differentiate multiple results for one commit
category: matlab
test:
strategy:
fail-fast: false # Run with every MATLAB version independently
matrix:
matlabVer: [R2022b, R2023a, R2023b] # List of MATLAB releases to test
runs-on: matlab
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.8
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Check out repo
uses: actions/checkout@v3
with:
submodules: 'recursive'
token: ${{ secrets.REPO_READ_TOKEN }}
#- name: Cache MATLAB build files
# uses: actions/cache@v3
# with:
# key: matlab-buildtool
# path: |
# buildUtilities/.buildtool
- name: Download firmware artifact
uses: dawidd6/action-download-artifact@v2
with:
github_token: ${{ secrets.REPO_READ_TOKEN }}
workflow: main.yml
repo: sync2brain/bossdevice-firmware
branch: main
search_artifacts: true
name: bossdevice-firmware-${{ matrix.matlabVer }}
path: toolbox/dependencies/firmware
if_no_artifact_found: fail
- name: Run MATLAB command
timeout-minutes: 30
run: |
&"$env:ProgramFiles\MATLAB\${{ matrix.matlabVer }}\bin\matlab.exe" -batch "openProject(pwd); updateSGdeps; testTask({'noHW','bdConnected'});"
# MATLAB R2022b does not support input arguments to buildtool
#run: |
# &"$env:ProgramFiles\MATLAB\${{ matrix.matlabVer }}\bin\matlab.exe" -batch "openProject(pwd); cd('buildUtilities'); buildtool test({'noHW','bdConnected'});"
- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action/composite@v2
if: success() || failure()
with:
check_name: "Test Results ${{ matrix.matlabVer }}"
action_fail: true
files: |
results.xml
- name: Upload Speedgoat dependencies as artifacts
if: ${{ github.ref == 'refs/heads/master' }}
uses: actions/upload-artifact@v3
with:
name: speedgoat-deps-${{ matrix.matlabVer }}
path: toolbox\dependencies\sg
if-no-files-found: error