MATLAB #49
This file contains hidden or 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
| name: MATLAB | |
| on: | |
| push: | |
| pull_request: | |
| workflow_dispatch: {} | |
| env: | |
| MLM_LICENSE_TOKEN: ${{ secrets.MLM_LICENSE_TOKEN }} | |
| jobs: | |
| test: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, windows-latest, macos-latest] | |
| release: [R2022b, latest] | |
| exclude: | |
| # macos-latest is ARM; R2022b predates Apple Silicon support (R2023b+). | |
| - os: macos-latest | |
| release: R2022b | |
| # Disabled: macos-13 runners are slow to provision. | |
| # include: | |
| # - os: macos-13 | |
| # release: R2022b | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up MATLAB | |
| uses: matlab-actions/setup-matlab@v3 | |
| with: | |
| release: ${{ matrix.release }} | |
| cache: true | |
| - name: Run MATLAB build | |
| uses: matlab-actions/run-build@v3 | |
| with: | |
| tasks: test | |
| - name: Upload coverage reports | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: coverage-${{ matrix.os }}-${{ matrix.release }} | |
| path: coverage/ | |
| if-no-files-found: error | |
| coverage: | |
| runs-on: ubuntu-latest | |
| needs: test | |
| if: always() | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Download all coverage artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| pattern: coverage-* | |
| path: coverage-reports/ | |
| - name: Set up MATLAB | |
| uses: matlab-actions/setup-matlab@v3 | |
| with: | |
| release: latest | |
| cache: true | |
| - name: Merge coverage reports | |
| uses: matlab-actions/run-command@v3 | |
| with: | |
| command: | | |
| addpath("buildUtilities"); | |
| mergeCoverageReports("coverage-reports", "coverage-combined/summary.md"); | |
| - name: Write summary to job page | |
| run: cat coverage-combined/summary.md >> "$GITHUB_STEP_SUMMARY" | |
| package: | |
| runs-on: ubuntu-latest | |
| needs: test | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up MATLAB | |
| uses: matlab-actions/setup-matlab@v3 | |
| with: | |
| release: latest | |
| cache: true | |
| - name: Build toolbox | |
| uses: matlab-actions/run-build@v3 | |
| with: | |
| tasks: mltbx | |
| - name: Upload toolbox artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: MATLAB_Toolbox_for_TOML_and_YAML.mltbx | |
| path: release/MATLAB_Toolbox_for_TOML_and_YAML.mltbx |