Skip to content

Refactors NS and Dream to exit quicker when stopped and refactors alignALProfiles so it works for bayes and live plots. #1028

Refactors NS and Dream to exit quicker when stopped and refactors alignALProfiles so it works for bayes and live plots.

Refactors NS and Dream to exit quicker when stopped and refactors alignALProfiles so it works for bayes and live plots. #1028

Workflow file for this run

name: Run Unit Tests
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
concurrency:
group: ${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
build_cpp:
runs-on: Linux
steps:
- name: Checkout RAT
uses: actions/checkout@v5
- name: Generate CPP
uses: matlab-actions/run-command@v2
with:
command: addPaths; generateCpps;
- name: Upload cppDeploy
uses: actions/upload-artifact@v4
with:
name: cppDeploy
retention-days: 1
path: compile/fullCompile/cppDeploy/
- name: Upload cppDeploy
uses: actions/upload-artifact@v4
with:
name: codegen
retention-days: 1
path: compile/fullCompile/codegen/
build_and_test_mex:
strategy:
matrix:
platform: [windows-2022, ubuntu-22.04, macos-15-intel, macos-15]
runs-on: ${{ matrix.platform }}
needs: [build_cpp]
steps:
- name: Checkout RAT
uses: actions/checkout@v5
- name: Download Mex CPP
uses: actions/download-artifact@v4
with:
name: codegen
path: compile/fullCompile/codegen/
- name: Set up MATLAB
uses: matlab-actions/setup-matlab@v2
with:
release: R2023a
products: Parallel_Computing_Toolbox
- name: Build Mex and Run Tests
uses: matlab-actions/run-command@v2
with:
command: addPaths; generateMexFromCpp; testScript
- name: Create build archive (Windows and macOS)
if: runner.os != 'Linux'
run: tar --exclude="**/-lang:c++.zip" --exclude=".git*/" --exclude="**/codegen/" --exclude="htmlcov/" -acvf ../${{ runner.os }}-${{ runner.arch }}.zip *
- name: Create build archive (Linux)
if: runner.os == 'Linux'
run: zip -r ../${{ runner.os }}-${{ runner.arch }}.zip * -x "**/-lang:c++.zip" ".git*/" "htmlcov/*" "**/codegen/*"
- run: mv ../${{ runner.os }}-${{ runner.arch }}.zip ${{ runner.os }}-${{ runner.arch }}.zip
- name: Upload releases
uses: actions/upload-artifact@v4
with:
name: ${{ runner.os }}-${{ runner.arch }}
retention-days: 1
path: ${{ runner.os }}-${{ runner.arch }}.zip
deploy-nightly:
if: github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
needs: [build_and_test_mex]
permissions:
contents: write
steps:
- name: Get artifacts
uses: actions/download-artifact@v4
with:
merge-multiple: true
- name: Create nightly release
run: |
mv Linux-X64.zip Linux.zip
mv Windows-X64.zip Windows.zip
output=$(gh release delete nightly --cleanup-tag --yes --repo ${{ github.repository }} 2>&1) || [[ "${output}" == "release not found" ]]
gh release create nightly Windows.zip Linux.zip macOS-X64.zip macOS-ARM64.zip --prerelease --title "Nightly Build" --latest=false --repo ${{ github.repository }}
env:
GH_TOKEN: ${{ github.token }}
cpp-deploy:
if: github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
needs: [build_and_test_mex]
steps:
- name: Checkout Source
uses: actions/checkout@v5
with:
ref: generated_source
path: rat_source
- name: Get cppDeploy
uses: actions/download-artifact@v4
with:
name: cppDeploy
path: cppDeploy/
- name: Deploy Source
run: |
rm -rf rat_source/*.c rat_source/*.cpp rat_source/*.h rat_source/*.hpp
rsync -av cppDeploy/ rat_source/
cd rat_source
git config user.name github-actions
git config user.email github-actions@github.com
git add -A
git commit -m "Deploy Source Code" || true
git push