Debug YAML #55
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: MVC App Actions | |
| on: | |
| push: | |
| branches: [main] | |
| tags: | |
| - 'v*' | |
| pull_request: | |
| branches: [main] | |
| workflow_dispatch: | |
| jobs: | |
| run-tests: | |
| strategy: | |
| matrix: | |
| platform: [ubuntu-latest] | |
| matlab-version: [R2026a] | |
| runs-on: ${{ matrix.platform }} | |
| continue-on-error: false | |
| steps: | |
| - name: Check out the repository | |
| uses: actions/checkout@v4 | |
| - name: Start a display server for jobs running on Linux | |
| if: ${{ matrix.platform == 'ubuntu-latest' }} | |
| run: | | |
| sudo apt-get install -y xvfb | |
| Xvfb :99 & | |
| echo "DISPLAY=:99" >> $GITHUB_ENV | |
| - name: Set up MATLAB on the runner | |
| uses: matlab-actions/setup-matlab@v2 | |
| with: | |
| products: MATLAB | |
| release: ${{ matrix.matlab-version }} | |
| - name: Run the toolbox tests | |
| uses: matlab-actions/run-command@v2 | |
| with: | |
| command: | | |
| toolboxFile = websave( "TestFrameworkExtensions.mltbx", "https://github.com/mathworks/test-framework-extensions/releases/latest/download/TestFrameworkExtensions.mltbx" ); | |
| fileCleanup = onCleanup( @() delete( toolboxFile ) ); | |
| matlab.addons.install( toolboxFile, true ); | |
| openProject( "MVC.prj" ); | |
| buildtool test | |
| package-and-release-toolbox: | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out the repository | |
| uses: actions/checkout@v4 | |
| - name: Extract version from tag | |
| shell: bash | |
| run: | | |
| VERSION="${GITHUB_REF_NAME#v}" | |
| echo "VERSION=$VERSION" >> $GITHUB_ENV | |
| - name: Set up MATLAB on the runner | |
| uses: matlab-actions/setup-matlab@v2 | |
| with: | |
| products: MATLAB | |
| - name: Package toolbox | |
| uses: matlab-actions/run-command@v2 | |
| with: | |
| command: | | |
| logLines = readlines( "tbx/mvcapp/Changelog.md" ); | |
| startIdx = find( logLines == "## Version " + getenv( "VERSION" ) ); | |
| disp( "VERSION" ) | |
| allVersionLines = find( startsWith( logLines, "##" ) ); | |
| endIdx = find( allVersionLines > startIdx, 1 ) - 1; | |
| releaseNotes = join( logLines(startIdx:endIdx), "\n" ); | |
| setenv( "RELEASE_NOTES", releaseNotes ) | |
| - name: Release toolbox | |
| uses: softprops/action-gh-release@v3 | |
| with: | |
| name: MVC App ${{ env.VERSION }} | |
| tag_name: v${{ env.VERSION }} | |
| body: ${{ env.RELEASE_NOTES }} | |
| draft: false | |
| make_latest: true | |
| files: releases/MVC_App.mltbx | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |