From 1d5ff3a01acc89a888c3e0482a942a564a71f632 Mon Sep 17 00:00:00 2001 From: Chemaclass Date: Sat, 18 Apr 2026 12:44:13 +0200 Subject: [PATCH 1/3] 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. --- .github/workflows/tests.yml | 116 +++++++++--------------------------- 1 file changed, 29 insertions(+), 87 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index a3792e2d..46c79e41 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -18,9 +18,23 @@ concurrency: jobs: ubuntu: - name: "Ubuntu - latest" + name: "Ubuntu - ${{ matrix.name }}" runs-on: ubuntu-latest timeout-minutes: 10 + strategy: + fail-fast: false + matrix: + include: + - name: "make test" + command: "make test" + - name: "simple" + command: "./bashunit --simple tests/" + - name: "parallel simple" + command: "./bashunit --parallel --simple tests/" + - name: "parallel extended" + command: "./bashunit --parallel tests/" + - name: "strict" + command: "./bashunit --parallel --simple --strict tests/" steps: - name: Checkout uses: actions/checkout@v4 @@ -31,7 +45,7 @@ jobs: run: cp .env.example .env - name: Run Tests - run: make test + run: ${{ matrix.command }} localized-ubuntu: name: "Ubuntu - ${{ matrix.name }} Locale" @@ -92,25 +106,23 @@ jobs: run: make test windows: - name: "On windows (${{ matrix.name }})" + name: "Windows - ${{ matrix.name }}" timeout-minutes: 10 runs-on: windows-latest strategy: + fail-fast: false matrix: include: - - name: functional + - name: "functional" test_path: "tests/functional/*_test.sh" - name: "unit a-b" test_path: "tests/unit/[a-b]*_test.sh" - - name: "unit c" - test_path: "tests/unit/ch*_test.sh tests/unit/cl*_test.sh tests/unit/console*_test.sh tests/unit/cu*_test.sh" - - name: "unit coverage" - test_path: "tests/unit/coverage_*_test.sh" + - name: "unit c + coverage" + 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" - name: "unit d-p" test_path: "tests/unit/[d-p]*_test.sh" - name: "unit r-z" test_path: "tests/unit/[r-z]*_test.sh" - fail-fast: false steps: - name: Checkout code uses: actions/checkout@v4 @@ -123,24 +135,23 @@ jobs: - name: Run tests shell: bash - run: | - ./bashunit --parallel --jobs 4 ${{ matrix.test_path }} + run: ./bashunit --parallel --jobs 4 ${{ matrix.test_path }} windows-acceptance: - name: "On windows (${{ matrix.name }})" + name: "Windows acceptance - ${{ matrix.name }}" if: github.event_name == 'push' timeout-minutes: 10 runs-on: windows-latest strategy: + fail-fast: false matrix: include: - - name: "acceptance a-e" + - name: "a-e" test_path: "tests/acceptance/bashunit_[a-e]*_test.sh" - - name: "acceptance f-l" + - name: "f-l" test_path: "tests/acceptance/bashunit_[f-l]*_test.sh" - - name: "acceptance m-z" + - name: "m-z" test_path: "tests/acceptance/bashunit_[m-z]*_test.sh tests/acceptance/[i-p]*_test.sh" - fail-fast: false steps: - name: Checkout code uses: actions/checkout@v4 @@ -153,11 +164,10 @@ jobs: - name: Run tests shell: bash - run: | - ./bashunit --parallel --jobs 4 ${{ matrix.test_path }} + run: ./bashunit --parallel --jobs 4 ${{ matrix.test_path }} alpine: - name: "On alpine-latest" + name: "Alpine - latest" runs-on: ubuntu-latest timeout-minutes: 10 steps: @@ -177,71 +187,3 @@ jobs: adduser -D builder && \ chown -R builder /project && \ su - builder -c 'cd /project; make test';" - - simple-output: - name: "Simple output" - runs-on: ubuntu-latest - timeout-minutes: 10 - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 1 - - - name: Setup Config - run: cp .env.example .env - - - name: Run Tests - run: | - ./bashunit --simple tests/ - - simple-output-parallel: - name: "Simple output in parallel" - runs-on: ubuntu-latest - timeout-minutes: 10 - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 1 - - - name: Setup Config - run: cp .env.example .env - - - name: Run Tests - run: | - ./bashunit --parallel --simple tests/ - - extended-output-parallel: - name: "Extended output in parallel" - runs-on: ubuntu-latest - timeout-minutes: 10 - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 1 - - - name: Setup Config - run: cp .env.example .env - - - name: Run Tests - run: | - ./bashunit --parallel tests/ - - strict-mode: - name: "Strict mode" - runs-on: ubuntu-latest - timeout-minutes: 10 - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 1 - - - name: Setup Config - run: cp .env.example .env - - - name: Run Tests with strict mode - run: | - ./bashunit --parallel --simple --strict tests/ From e84643df6df589c99194f2c5cfa49111d3ffdf0d Mon Sep 17 00:00:00 2001 From: Chemaclass Date: Sat, 18 Apr 2026 12:48:30 +0200 Subject: [PATCH 2/3] ci(tests): split windows unit d-p shard to cut wall-clock Previous run showed `unit d-p` as the slowest shard at ~2m01s. Split into `unit d-g` (6 files, ~820 LOC) and `unit h-p` (4 files, ~848 LOC, includes the heavy `helpers_test.sh` and `parallel_test.sh`). Wall-clock target drops to ~1m per shard. Adds one runner, halves Windows completion time. --- .github/workflows/tests.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 46c79e41..1e5af869 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -119,8 +119,10 @@ jobs: test_path: "tests/unit/[a-b]*_test.sh" - name: "unit c + coverage" 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" - - name: "unit d-p" - test_path: "tests/unit/[d-p]*_test.sh" + - name: "unit d-g" + test_path: "tests/unit/[d-g]*_test.sh" + - name: "unit h-p" + test_path: "tests/unit/[h-p]*_test.sh" - name: "unit r-z" test_path: "tests/unit/[r-z]*_test.sh" steps: From 1b0699d5fd1ab64a837721bda6986401dd1f6a8a Mon Sep 17 00:00:00 2001 From: Chemaclass Date: Sat, 18 Apr 2026 12:55:12 +0200 Subject: [PATCH 3/3] ci(tests): drop explicit name on windows-acceptance to fix skipped label GitHub evaluates job-level `if:` before matrix expansion, so a skipped job with a `${{ matrix.name }}` template leaks the raw template into the PR checks UI. Removing the explicit `name:` lets GitHub auto-name from the job id (`windows-acceptance` when skipped, `windows-acceptance (a-e)` etc. when running). --- .github/workflows/tests.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 1e5af869..2122d9fa 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -140,7 +140,6 @@ jobs: run: ./bashunit --parallel --jobs 4 ${{ matrix.test_path }} windows-acceptance: - name: "Windows acceptance - ${{ matrix.name }}" if: github.event_name == 'push' timeout-minutes: 10 runs-on: windows-latest