3434 with :
3535 cache : ' npm'
3636 node-version-file : ' .nvmrc'
37- - name : Debug info
37+ - name : Debug Info
3838 # https://docs.github.com/en/actions/reference/security/secure-use#use-an-intermediate-environment-variable
3939 env :
4040 # `env:` values are printed to the log even without using them in `run:`
5454 with :
5555 filters : ./.github/path-filters.yml
5656
57- - name : Resolve changed packages
57+ - name : Resolve Changed Packages
5858 id : filter
5959 run : |
6060 if [ "${{ inputs.force-full-build }}" = "true" ]; then
@@ -70,14 +70,12 @@ jobs:
7070 - if : ${{ steps.filter.outputs.any-workspace == 'true' }}
7171 uses : ./.github/actions/install-dependencies
7272
73- # IMPORTANT: always build all packages or none - never a subset.
74- # The publish workflow reuses these artifacts, so partial artifacts would cause publish
75- # failures for omitted packages.
76- - name : Build packages
73+ # TODO: Packages currently depend on each other's compiled dist at build time. Fix that and matrix the builds.
74+ - name : Build Packages
7775 if : ${{ steps.filter.outputs.any-workspace == 'true' }}
7876 run : npm run build
7977
80- - name : Store build artifacts
78+ - name : Store Build Artifacts
8179 if : ${{ steps.filter.outputs.any-workspace == 'true' }}
8280 uses : actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
8381 with :
@@ -89,36 +87,15 @@ jobs:
8987 packages/**/playground
9088
9189 test :
92- runs-on : ubuntu-latest
90+ name : Test
9391 needs : build
9492 if : ${{ needs.build.outputs.any-workspace == 'true' && needs.build.outputs.packages != '[]' }}
95- permissions :
96- checks : write
97- pull-requests : write
98- contents : read
99- issues : read
100- strategy :
101- fail-fast : false
102- matrix :
103- package : ${{ fromJSON(needs.build.outputs.packages) }}
104- name : Test ${{ matrix.package }}
105- steps :
106- - uses : actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
107- - uses : actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6
108- with :
109- cache : ' npm'
110- node-version-file : ' .nvmrc'
111- - uses : ./.github/actions/install-dependencies
112- - uses : actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6
113- with :
114- name : build
115- path : packages
116- - uses : ./.github/actions/test-package
117- with :
118- package_name : ${{ matrix.package }}
93+ uses : ./.github/workflows/test-packages.yml
94+ with :
95+ packages : ${{ needs.build.outputs.packages }}
11996
12097 preview :
121- runs-on : ubuntu-latest
98+ name : Preview
12299 needs : build
123100 # We don't want to give forks free reign to publish to our GitHub Pages, so run this job only if both:
124101 # - any workspace changed (otherwise there's no work to do)
@@ -135,68 +112,9 @@ jobs:
135112 ) &&
136113 (!startsWith((github.head_ref || github.ref_name), 'renovate/'))
137114 }}
138- name : Publish preview playgrounds to GitHub Pages
139- steps :
140- - uses : actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
141- with :
142- sparse-checkout : .github/actions/deploy-pages-with-retry/
143- fetch-depth : 1
144- sparse-checkout-cone-mode : true
145- persist-credentials : false
146- lfs : false
147- submodules : false
148- - name : Determine GitHub Pages directory name
149- id : branch_dir_name
150- # even `develop` should be published to a subdirectory
151- # that way each branch can be updated or cleaned up independently
152- run : |
153- echo "result=${GITHUB_REF_NAME//[^A-Za-z0-9._-]/_}" | tee --append "$GITHUB_OUTPUT"
154- - uses : actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6
155- with :
156- name : build
157- path : packages
158- - name : Prepare playgrounds for GitHub Pages
159- working-directory : ./packages
160- run : |
161- mkdir -p ../pages/
162- for pkg in *; do
163- if [ -d "${pkg}/playground" ]; then
164- # using symlinks is quick and artifact generation will dereference them
165- # if the GitHub Pages action stops dereferencing these links, we'll need to copy the files instead
166- ln -s "../packages/${pkg}/playground" "../pages/${pkg}"
167- fi
168- done
169-
170- # scratch-gui doesn't follow the pattern above
171- ln -s "../packages/scratch-gui/build" "../pages/scratch-gui"
172-
173- ls -l ../pages/
174- - name : Deploy playgrounds to GitHub Pages
175- uses : ./.github/actions/deploy-pages-with-retry
176- with :
177- github_token : ${{ secrets.GITHUB_TOKEN }}
178- publish_dir : ./pages
179- destination_dir : " ${{steps.branch_dir_name.outputs.result}}"
180- full_commit_message : " Build for ${{ github.sha }} ${{ github.event.head_commit.message }}"
181-
182- results :
183- name : Test Results
184- runs-on : ubuntu-latest
185- needs : test
186- if : ${{ !cancelled() && needs.test.result != 'skipped' }}
187- steps :
188- - run : |
189- case "${{ needs.test.result }}" in
190- success)
191- echo "Tests passed successfully."
192- exit 0
193- ;;
194- cancelled)
195- echo "Tests were cancelled."
196- exit 1
197- ;;
198- *)
199- echo "Tests failed. Result: ${{ needs.test.result }}"
200- exit 1
201- ;;
202- esac
115+ uses : ./.github/workflows/deploy-playground-preview.yml
116+ with :
117+ # even `develop` should be published to a subdirectory
118+ # that way each branch can be updated or cleaned up independently
119+ destination_dir : ${{ github.head_ref || github.ref_name }}
120+ full_commit_message : " Build for ${{ github.sha }} ${{ github.event.head_commit.message }}"
0 commit comments