-
Notifications
You must be signed in to change notification settings - Fork 5
118 lines (111 loc) · 3.67 KB
/
runTests.yml
File metadata and controls
118 lines (111 loc) · 3.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
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-latest, ubuntu-22.04, macos-15-intel, macos-latest]
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