Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 23 additions & 9 deletions .github/workflows/bat.yml
Original file line number Diff line number Diff line change
@@ -1,48 +1,62 @@
name: Build and Test
on: [push]
permissions:
contents: read

jobs:
bat:
name: Build and Test
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
- uses: actions/checkout@v5
- uses: actions/setup-node@v5
with:
node-version: 20
- name: Perform npm tasks
run: npm run ci
- uses: actions/upload-artifact@v4
with:
name: built-action
path: |
**/*
!node_modules/

integ:
needs: bat
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest, macos-14]
steps:
- uses: actions/download-artifact@v5
with:
name: built-action
- name: Perform 'setup-matlab'
uses: matlab-actions/setup-matlab@v2
with:
products: |
Simulink
Simulink_Test
Simulink_Coverage

- name: Run MATLAB Tests
uses: ./
with:
source-folder: sample
startup-options: -logfile output.log

- name: Verify option application
run: |
set -e
grep "Running TheTruth" output.log
grep "Done TheTruth" output.log
grep "1 Passed" output.log

shell: bash
- name: Generate Model
uses: matlab-actions/run-command@v2
with:
command: cd('sample'),createSampleModel('temp_model'),sltest.testmanager.createTestsFromModel('sltestfile', 'temp_model');

- name: Set up diary for logging
run: echo 'diary console.log' >> startup.m

- name: Run run-test command
uses: ./
with:
Expand All @@ -54,7 +68,6 @@ jobs:
use-parallel: true
output-detail: Detailed
logging-level: Detailed

- name: Verify artifacts generation
run: |
(test -f test-results/simulinktest.mldatx) || (echo "File simulinktest.mldatx does not exist" && exit 1)
Expand All @@ -64,3 +77,4 @@ jobs:
grep -q "runInParallel" console.log
grep -q "'OutputDetail', 3" console.log
grep -q "'LoggingLevel', 3" console.log
shell: bash
16 changes: 6 additions & 10 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
name: Publish

on:
release:
types: [published, edited]
types: published
permissions:
contents: write

jobs:
build:
Expand All @@ -11,15 +12,12 @@ jobs:
outputs:
tag: ${{ steps.update-package-version.outputs.version }}
steps:
# Configure runner with the right stuff
- uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@v5
- name: Configure git
run: |
git config user.name 'Release Action'
git config user.email '<>'
- uses: actions/setup-node@v4
- uses: actions/setup-node@v5
with:
node-version: 20

Expand All @@ -31,7 +29,6 @@ jobs:
run: |
git tag -d "${{ github.event.release.tag_name }}"
VERSION=$(npm version "${{ github.event.release.tag_name }}" --no-git-tag-version)
echo "::set-output name=version::$VERSION"
git add package.json package-lock.json
git commit -m "[skip ci] Bump $VERSION"
git push origin HEAD:main
Expand All @@ -47,8 +44,8 @@ jobs:
id: release_info
run: |
# Check for semantic versioning
echo "Preparing release for version $longVersion"
longVersion="${{github.event.release.tag_name}}"
echo "Preparing release for version $longVersion"
[[ $longVersion == v[0-9]*.[0-9]*.[0-9]* ]] || (echo "must follow semantic versioning" && exit 1)
majorVersion=$(echo ${longVersion%.*.*})
minorVersion=$(echo ${longVersion%.*})
Expand Down Expand Up @@ -78,4 +75,3 @@ jobs:
git push -f origin $longVersion
git push -f origin $majorVersion
git push -f origin $minorVersion

Loading