Skip to content

Commit aa359d6

Browse files
Update bat.yml
1 parent eb4172a commit aa359d6

1 file changed

Lines changed: 36 additions & 7 deletions

File tree

.github/workflows/bat.yml

Lines changed: 36 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,42 @@
11
name: Build and Test
22
on: [push]
3+
permissions:
4+
contents: read
35

46
jobs:
57
bat:
68
name: Build and Test
79
runs-on: ubuntu-latest
810
steps:
9-
- uses: actions/checkout@v4
10-
- uses: actions/setup-node@v4
11+
- uses: actions/checkout@v5
12+
- uses: actions/setup-node@v5
1113
with:
1214
node-version: "20"
1315
- name: Perform npm tasks
1416
run: npm run ci
17+
- uses: actions/upload-artifact@v4
18+
with:
19+
name: built-action
20+
path: |
21+
**/*
22+
!node_modules/
23+
integ:
24+
needs: bat
25+
runs-on: ${{ matrix.os }}
26+
strategy:
27+
fail-fast: false
28+
matrix:
29+
os: [ubuntu-latest, windows-latest, macos-latest, macos-14]
30+
steps:
31+
- uses: actions/download-artifact@v5
32+
with:
33+
name: built-action
1534

1635
- name: Perform 'setup-matlab'
1736
uses: matlab-actions/setup-matlab@v2
1837

1938
- name: Create buildfile.m in project root for tests
39+
shell: bash
2040
run: |
2141
cat <<'_EOF' >> "buildfile.m"
2242
function plan = buildfile
@@ -56,6 +76,7 @@ jobs:
5676
uses: ./
5777

5878
- name: Verify correct tasks appear in buildlog.txt
79+
shell: bash
5980
run: |
6081
set -e
6182
grep "building" buildlog.txt
@@ -72,6 +93,7 @@ jobs:
7293
tasks: deploy
7394

7495
- name: Verify correct tasks appear in buildlog.txt
96+
shell: bash
7597
run: |
7698
set -e
7799
grep "building" buildlog.txt
@@ -88,6 +110,7 @@ jobs:
88110
tasks: deploy check
89111

90112
- name: Verify correct tasks appear in buildlog.txt
113+
shell: bash
91114
run: |
92115
set -e
93116
grep "building" buildlog.txt
@@ -102,8 +125,9 @@ jobs:
102125
uses: ./
103126
with:
104127
tasks: test("myTests", OutputDetail="concise")
105-
128+
106129
- name: Verify correct tasks appear in buildlog.txt
130+
shell: bash
107131
run: |
108132
set -e
109133
grep "building" buildlog.txt
@@ -120,6 +144,7 @@ jobs:
120144
startup-options: -logfile console.log
121145

122146
- name: Verify tasks appear in buildlog.txt and console.log
147+
shell: bash
123148
run: |
124149
set -e
125150
grep "building" buildlog.txt
@@ -140,8 +165,9 @@ jobs:
140165
with:
141166
tasks: deploy
142167
build-options: -skip test
143-
168+
144169
- name: Verify correct tasks appear in buildlog.txt
170+
shell: bash
145171
run: |
146172
set -e
147173
grep "building" buildlog.txt
@@ -151,15 +177,16 @@ jobs:
151177
grep "deploying" buildlog.txt
152178
! grep "checking" buildlog.txt
153179
rm buildlog.txt
154-
180+
155181
- name: Run build with continue on failure
156182
continue-on-error: true
157183
uses: ./
158184
with:
159185
tasks: error deploy
160186
build-options: -continueOnFailure
161-
187+
162188
- name: Verify correct tasks appear in buildlog.txt
189+
shell: bash
163190
run: |
164191
set -e
165192
grep "erroring" buildlog.txt
@@ -180,6 +207,7 @@ jobs:
180207
startup-options: -logfile console.log
181208

182209
- name: Verify workflow command is added
210+
shell: bash
183211
run: |
184212
grep "::group::deploy" console.log
185213
grep "::error::error task failed" console.log
@@ -194,8 +222,9 @@ jobs:
194222
startup-options: -logfile console.log
195223

196224
- name: Verify summary exception for invalid task
225+
shell: bash
197226
run: |
198227
set -e
199228
! grep "while reading the build summary file:" console.log
200229
! grep "trying to delete the build summary" console.log
201-
rm console.log
230+
rm console.log

0 commit comments

Comments
 (0)