Skip to content

Add example for array usage. #55

Add example for array usage.

Add example for array usage. #55

Workflow file for this run

# This is a basic workflow to help you get started with Actions
name: CI
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request on main branch
push:
branches:
- main
pull_request:
branches:
- main
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
test:
strategy:
matrix:
version: [R2024a, R2022b]
os: [ubuntu-latest, windows-latest]
# The type of runner that the job will run on
runs-on: ${{ matrix.os }}
continue-on-error: true
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Get badge OS Name
shell: bash
run: |
if [ "${{ matrix.os }}" == "ubuntu-latest" ]; then
echo "archstr=GLNXA64" >> "$GITHUB_ENV"
elif [ "${{ matrix.os }}" == "windows-latest" ]; then
echo "archstr=PCWIN64" >> "$GITHUB_ENV"
else
echo "archstr=ARCH_UNKNOWN" >> "$GITHUB_ENV"
fi
- name: Setup MATLAB
uses: matlab-actions/setup-matlab@v2
with:
release: ${{ matrix.version }}
- name: Run tests
uses: matlab-actions/run-command@v2
with:
command: workflow_ci
- name: Upload test results
uses: actions/upload-artifact@v4
with:
name: test-results-${{ matrix.os }}-${{ matrix.version }}
path: test-results/results.xml
- name: Upload code coverage
uses: actions/upload-artifact@v4
with:
name: code-coverage-${{ matrix.os }}-${{ matrix.version }}
path: test-results/coverage.xml
- name: Upload badges
uses: actions/upload-artifact@v4
with:
name: badges-${{ matrix.os }}-${{ matrix.version }}
path: resources/${{ env.archstr }}-${{ matrix.version }}-*.svg
update_resources:
if: always()
needs: [test]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Copy failed logos
shell: bash
run: |
cp resources/failed/* resources/
- name: Download badges
uses: actions/download-artifact@v4
with:
pattern: badges-*
path: resources/
merge-multiple: true
- name: Push resources
if: always()
shell: bash
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add resources/*
if ! git diff-index --quiet HEAD; then
git commit -m "Update resources from GitHub Actions job"
git push
fi