Skip to content

Commit 1d5ff3a

Browse files
committed
ci(tests): optimize workflow jobs and windows shards
Consolidate 5 standalone Ubuntu full-suite jobs into a single matrix. Rebalance Windows shards (6 to 5) by merging `unit c` with `unit coverage`. Rename Windows jobs to remove name collision between `windows` and `windows-acceptance` (the skipped job on PRs now shows a clean label). Keep acceptance matrix push-only.
1 parent 8e128ec commit 1d5ff3a

File tree

1 file changed

+29
-87
lines changed

1 file changed

+29
-87
lines changed

.github/workflows/tests.yml

Lines changed: 29 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,23 @@ concurrency:
1818

1919
jobs:
2020
ubuntu:
21-
name: "Ubuntu - latest"
21+
name: "Ubuntu - ${{ matrix.name }}"
2222
runs-on: ubuntu-latest
2323
timeout-minutes: 10
24+
strategy:
25+
fail-fast: false
26+
matrix:
27+
include:
28+
- name: "make test"
29+
command: "make test"
30+
- name: "simple"
31+
command: "./bashunit --simple tests/"
32+
- name: "parallel simple"
33+
command: "./bashunit --parallel --simple tests/"
34+
- name: "parallel extended"
35+
command: "./bashunit --parallel tests/"
36+
- name: "strict"
37+
command: "./bashunit --parallel --simple --strict tests/"
2438
steps:
2539
- name: Checkout
2640
uses: actions/checkout@v4
@@ -31,7 +45,7 @@ jobs:
3145
run: cp .env.example .env
3246

3347
- name: Run Tests
34-
run: make test
48+
run: ${{ matrix.command }}
3549

3650
localized-ubuntu:
3751
name: "Ubuntu - ${{ matrix.name }} Locale"
@@ -92,25 +106,23 @@ jobs:
92106
run: make test
93107

94108
windows:
95-
name: "On windows (${{ matrix.name }})"
109+
name: "Windows - ${{ matrix.name }}"
96110
timeout-minutes: 10
97111
runs-on: windows-latest
98112
strategy:
113+
fail-fast: false
99114
matrix:
100115
include:
101-
- name: functional
116+
- name: "functional"
102117
test_path: "tests/functional/*_test.sh"
103118
- name: "unit a-b"
104119
test_path: "tests/unit/[a-b]*_test.sh"
105-
- name: "unit c"
106-
test_path: "tests/unit/ch*_test.sh tests/unit/cl*_test.sh tests/unit/console*_test.sh tests/unit/cu*_test.sh"
107-
- name: "unit coverage"
108-
test_path: "tests/unit/coverage_*_test.sh"
120+
- name: "unit c + coverage"
121+
test_path: "tests/unit/ch*_test.sh tests/unit/cl*_test.sh tests/unit/console*_test.sh tests/unit/cu*_test.sh tests/unit/coverage_*_test.sh"
109122
- name: "unit d-p"
110123
test_path: "tests/unit/[d-p]*_test.sh"
111124
- name: "unit r-z"
112125
test_path: "tests/unit/[r-z]*_test.sh"
113-
fail-fast: false
114126
steps:
115127
- name: Checkout code
116128
uses: actions/checkout@v4
@@ -123,24 +135,23 @@ jobs:
123135

124136
- name: Run tests
125137
shell: bash
126-
run: |
127-
./bashunit --parallel --jobs 4 ${{ matrix.test_path }}
138+
run: ./bashunit --parallel --jobs 4 ${{ matrix.test_path }}
128139

129140
windows-acceptance:
130-
name: "On windows (${{ matrix.name }})"
141+
name: "Windows acceptance - ${{ matrix.name }}"
131142
if: github.event_name == 'push'
132143
timeout-minutes: 10
133144
runs-on: windows-latest
134145
strategy:
146+
fail-fast: false
135147
matrix:
136148
include:
137-
- name: "acceptance a-e"
149+
- name: "a-e"
138150
test_path: "tests/acceptance/bashunit_[a-e]*_test.sh"
139-
- name: "acceptance f-l"
151+
- name: "f-l"
140152
test_path: "tests/acceptance/bashunit_[f-l]*_test.sh"
141-
- name: "acceptance m-z"
153+
- name: "m-z"
142154
test_path: "tests/acceptance/bashunit_[m-z]*_test.sh tests/acceptance/[i-p]*_test.sh"
143-
fail-fast: false
144155
steps:
145156
- name: Checkout code
146157
uses: actions/checkout@v4
@@ -153,11 +164,10 @@ jobs:
153164

154165
- name: Run tests
155166
shell: bash
156-
run: |
157-
./bashunit --parallel --jobs 4 ${{ matrix.test_path }}
167+
run: ./bashunit --parallel --jobs 4 ${{ matrix.test_path }}
158168

159169
alpine:
160-
name: "On alpine-latest"
170+
name: "Alpine - latest"
161171
runs-on: ubuntu-latest
162172
timeout-minutes: 10
163173
steps:
@@ -177,71 +187,3 @@ jobs:
177187
adduser -D builder && \
178188
chown -R builder /project && \
179189
su - builder -c 'cd /project; make test';"
180-
181-
simple-output:
182-
name: "Simple output"
183-
runs-on: ubuntu-latest
184-
timeout-minutes: 10
185-
steps:
186-
- name: Checkout
187-
uses: actions/checkout@v4
188-
with:
189-
fetch-depth: 1
190-
191-
- name: Setup Config
192-
run: cp .env.example .env
193-
194-
- name: Run Tests
195-
run: |
196-
./bashunit --simple tests/
197-
198-
simple-output-parallel:
199-
name: "Simple output in parallel"
200-
runs-on: ubuntu-latest
201-
timeout-minutes: 10
202-
steps:
203-
- name: Checkout
204-
uses: actions/checkout@v4
205-
with:
206-
fetch-depth: 1
207-
208-
- name: Setup Config
209-
run: cp .env.example .env
210-
211-
- name: Run Tests
212-
run: |
213-
./bashunit --parallel --simple tests/
214-
215-
extended-output-parallel:
216-
name: "Extended output in parallel"
217-
runs-on: ubuntu-latest
218-
timeout-minutes: 10
219-
steps:
220-
- name: Checkout
221-
uses: actions/checkout@v4
222-
with:
223-
fetch-depth: 1
224-
225-
- name: Setup Config
226-
run: cp .env.example .env
227-
228-
- name: Run Tests
229-
run: |
230-
./bashunit --parallel tests/
231-
232-
strict-mode:
233-
name: "Strict mode"
234-
runs-on: ubuntu-latest
235-
timeout-minutes: 10
236-
steps:
237-
- name: Checkout
238-
uses: actions/checkout@v4
239-
with:
240-
fetch-depth: 1
241-
242-
- name: Setup Config
243-
run: cp .env.example .env
244-
245-
- name: Run Tests with strict mode
246-
run: |
247-
./bashunit --parallel --simple --strict tests/

0 commit comments

Comments
 (0)