-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9a37d76
commit cabe486
Showing
1 changed file
with
29 additions
and
16 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,61 @@ | ||
name: MATLAB Build | ||
name: Module Test | ||
|
||
# Controls when the action will run. | ||
on: | ||
push: | ||
branches: [ release ] | ||
pull_request: | ||
branches: [ release ] | ||
workflow_dispatch: | ||
|
||
jobs: | ||
test: | ||
RunTests: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
MATLABVersion: [R2023a,R2023b] | ||
MATLABVersion: [R2021a,R2021b,R2022a,R2022b,R2023a,R2023b] | ||
runs-on: ubuntu-latest | ||
steps: | ||
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | ||
# Checks-out your repository | ||
- uses: actions/checkout@v3 | ||
|
||
# Sets up MATLAB on the GitHub Actions runner | ||
# Sets up MATLAB | ||
- name: Setup MATLAB | ||
uses: matlab-actions/setup-matlab@v1 | ||
with: | ||
release: ${{ matrix.MATLABVersion }} | ||
|
||
# Run SmokeTests | ||
# Run all the tests | ||
- name: Run SmokeTests | ||
uses: matlab-actions/run-command@v1 | ||
with: | ||
command: openProject(pwd); results = runtests(fullfile("SoftwareTests","SmokeTests.m")); assertSuccess(results); | ||
|
||
# Run FunctionTests | ||
- name: Run FunctionTests | ||
uses: matlab-actions/run-command@v1 | ||
with: | ||
command: openProject(pwd); results = runtests(fullfile("SoftwareTests","FunctionTests.m")); assertSuccess(results); | ||
command: openProject(pwd); RunAllTests; | ||
|
||
# Upload the test results as artifact | ||
- name: Upload TestResults | ||
if: always() | ||
uses: actions/[email protected] | ||
with: | ||
name: TestResults | ||
path: ./SoftwareTests/TestResults_${{ matrix.MATLABVersion }}.txt | ||
|
||
|
||
CreateBadge: | ||
if: ${{ always() }} | ||
needs: [RunTests] | ||
strategy: | ||
fail-fast: false | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
# Checks-out your repository | ||
- uses: actions/checkout@v3 | ||
|
||
# Sets up R2023b | ||
- name: Setup MATLAB | ||
uses: matlab-actions/setup-matlab@v1 | ||
with: | ||
release: R2023b | ||
|
||
# Download the test results from artifact | ||
- name: Download TestResults | ||
uses: actions/[email protected] | ||
|
@@ -55,7 +67,7 @@ jobs: | |
- name: Run CreateBadge | ||
uses: matlab-actions/run-command@v1 | ||
with: | ||
command: openProject(pwd); results = runtests(fullfile("SoftwareTests","CreateBadge.m")); | ||
command: openProject(pwd); CreateBadge; | ||
|
||
# Commit the JSON for the MATLAB releases badge | ||
- name: Commit changed files | ||
|
@@ -64,6 +76,7 @@ jobs: | |
git config user.name "${{ github.workflow }} by ${{ github.actor }}" | ||
git config user.email "<>" | ||
git pull | ||
git add | ||
git add Images/TestedWith.json | ||
git commit Images/TestedWith.json -m "Update CI badges ${{ github.ref_name }}" | ||
git fetch | ||
git push |