Skip to content

Commit 601f32c

Browse files
authored
Dynamic list of packages for the CI matrix. (#8965)
1 parent 2f175b1 commit 601f32c

File tree

1 file changed

+18
-15
lines changed

1 file changed

+18
-15
lines changed

.github/workflows/all-test.yml

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -64,25 +64,28 @@ 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: Checkout repository
73+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
74+
- name: List packages
75+
id: packages
76+
run: |
77+
DIRS=$(find . -maxdepth 1 -mindepth 1 -type d -printf '"%f"\n' | tr '\n' ',' | sed 's/,$//')
78+
echo "packages=[$DIRS]" >> $GITHUB_OUTPUT
79+
working-directory: pkg/
80+
6781
test_packages:
82+
name: pkg/${{matrix.package}}/
83+
runs-on: ubuntu-latest
84+
needs: define_pkg_list
6885
strategy:
6986
fail-fast: false
7087
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
88+
package: ${{ fromJson(needs.define_pkg_list.outputs.packages) }}
8689
steps:
8790
- name: Cache PUB_CACHE
8891
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684

0 commit comments

Comments
 (0)