Skip to content

Commit f3d538a

Browse files
committed
dynamic matrix
1 parent 2f175b1 commit f3d538a

File tree

1 file changed

+16
-15
lines changed

1 file changed

+16
-15
lines changed

.github/workflows/all-test.yml

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -64,25 +64,26 @@ jobs:
6464
- run: dart test -P presubmit --shard-index ${{matrix.shard}} --total-shards 8
6565
working-directory: app/
6666

67+
define_pkg_list:
68+
runs-on: ubuntu-latest
69+
outputs:
70+
packages: ${{ steps.packages.outputs.packages }}
71+
steps:
72+
- name: List packages
73+
id: packages
74+
run: |
75+
dirs=$(cd pkg && find . -type d -printf "\"%p\",")
76+
json_array=$(echo "[$dirs]" | sed 's/,$//' | jq -c '.')
77+
echo "packages=$json_array" >> "$GITHUB_OUTPUT"
78+
6779
test_packages:
80+
name: pkg/${{matrix.package}}/
81+
runs-on: ubuntu-latest
82+
needs: define_pkg_list
6883
strategy:
6984
fail-fast: false
7085
matrix:
71-
# TODO: use `dart pub workspace list --json` to get this list
72-
package:
73-
- api_builder
74-
- code_coverage
75-
- fake_gcloud
76-
- indexed_blob
77-
- pub_integration
78-
- pub_package_reader
79-
- _pub_shared
80-
- pub_worker
81-
- puppeteer_screenshots
82-
- web_app
83-
- web_css
84-
name: pkg/${{matrix.package}}/
85-
runs-on: ubuntu-latest
86+
package: ${{ fromJson(needs.define_pkg_list.outputs.packages) }}
8687
steps:
8788
- name: Cache PUB_CACHE
8889
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684

0 commit comments

Comments
 (0)