-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Loading status checks…
Update CI
Showing
1 changed file
with
44 additions
and
14 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 |
---|---|---|
|
@@ -13,29 +13,40 @@ jobs: | |
strategy: | ||
fail-fast: false | ||
matrix: | ||
MATLABVersion: [R2023a,R2023b,R2024a] | ||
MATLABVersion: [R2022b,R2023a,R2023b,R2024a] | ||
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 a display server | ||
- name: Start display server | ||
if: ${{ always() }} | ||
run: | | ||
sudo apt-get install xvfb | ||
Xvfb :99 & | ||
echo "DISPLAY=:99" >> $GITHUB_ENV | ||
# Sets up MATLAB | ||
- name: Setup MATLAB | ||
uses: matlab-actions/setup-matlab@v1 | ||
uses: matlab-actions/setup-matlab@v2 | ||
with: | ||
release: ${{ matrix.MATLABVersion }} | ||
products: # Simulink Statistics_and_Machine_Learning_Toolbox | ||
# List required products above in the format shown (and uncomment them) | ||
# List of product strings: | ||
# Simulink | ||
# Statistics_and_Machine_Learning_Toolbox | ||
# Simulink_Coder | ||
# Econometrics_Toolbox | ||
# Deep_Learning_Toolbox | ||
|
||
|
||
# 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 | ||
uses: matlab-actions/run-command@v2 | ||
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 | ||
|
@@ -44,6 +55,23 @@ jobs: | |
name: TestResults | ||
path: ./SoftwareTests/TestResults_${{ matrix.MATLABVersion }}.txt | ||
|
||
badge: | ||
if: ${{ always() }} | ||
needs: [test] | ||
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,14 +83,16 @@ 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 | ||
continue-on-error: true | ||
run: | | ||
git config user.name "${{ github.workflow }} by ${{ github.actor }}" | ||
git config user.email "<>" | ||
git pull | ||
git add Images/TestedWith.json | ||
git commit Images/TestedWith.json -m "Update CI badges ${{ github.ref_name }}" | ||
git fetch | ||
git push |