Skip to content

Commit

Permalink
Add CI
Browse files Browse the repository at this point in the history
  • Loading branch information
eszmw committed Dec 21, 2023
1 parent 6a82cfa commit a7136d5
Showing 1 changed file with 68 additions and 0 deletions.
68 changes: 68 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: MATLAB Build

# Controls when the action will run.
on:
push:
branches: [ release ]
pull_request:
branches: [ release ]
workflow_dispatch:

jobs:
test:
strategy:
fail-fast: false
matrix:
MATLABVersion: [R2023a,R2023b]
runs-on: ubuntu-latest
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 }}

# Run SmokeTests
- 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);

# Upload the test results as artifact
- name: Upload TestResults
uses: actions/upload-artifact@v3.1.3
with:
name: TestResults
path: ./SoftwareTests/TestResults_${{ matrix.MATLABVersion }}.txt

# Download the test results from artifact
- name: Download TestResults
uses: actions/download-artifact@v2.1.1
with:
name: TestResults
path: ./SoftwareTests/

# Create the test results badge
- name: Run CreateBadge
uses: matlab-actions/run-command@v1
with:
command: openProject(pwd); results = runtests(fullfile("SoftwareTests","CreateBadge.m"));

# 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 Images/TestedWith.json -m "Update CI badges ${{ github.ref_name }}"
git fetch
git push

0 comments on commit a7136d5

Please sign in to comment.