Update README.md #27
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: | |
# Triggers the workflow on push or pull request events but only for the main branch | |
push: | |
branches: [ release ] | |
pull_request: | |
branches: [ release ] | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
jobs: | |
test: | |
strategy: | |
fail-fast: false | |
matrix: | |
MATLABVersion: [R2022b, R2023a] | |
# This workflow contains a single job called "build" build: | |
# The type of runner that the job will run on | |
runs-on: ubuntu-latest | |
# 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@v1 | |
with: | |
release: ${{ matrix.MATLABVersion }} | |
# Runs a set of commands using the runners shell | |
- name: Run all tests | |
uses: matlab-actions/run-command@v1 | |
with: | |
command: addpath("buildutil"); testModule("ModuleName","Thermodynamics.prj","ReportSubdirectory","${{ matrix.MATLABVersion }}"); | |
# Save the contents of the report directory from each release into a single artifact. Since each release makes their own directory, they all update the same artifact. | |
- name: Save Report Directory | |
uses: actions/upload-artifact@v3 | |
if: always() | |
with: | |
name: report | |
path: report | |
# Generate the JSON for the releases tested badge | |
- name: Generate tested with badge | |
uses: matlab-actions/run-command@v1 | |
with: | |
command: addpath("buildutil"),badgesforModule() | |
# Publish test results from all the releases | |
- name: Publish Test Results | |
uses: EnricoMi/publish-unit-test-result-action@v2 | |
if: always() | |
with: | |
junit_files: "report/*/test-results.xml" | |
# Commit the JSON for the MATLAB releases badge | |
- name: commit changed files | |
continue-on-error: true | |
run: | | |
git config user.name "${{ github.workflow }} by ${{ github.actor }}" | |
git config user.email "<>" | |
git commit report/badge/tested_with.json -m "Final checkins for release ${{ github.ref_name }}" | |
git fetch | |
git push |