Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/actions/test-package/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ runs:
# per-package browser list, and Firefox in scratch-render is
# cheap unused weight rather than a correctness problem.
run: npx playwright install --with-deps chromium firefox
- name: Explicitly install Rolldown linux binaries
shell: bash
run: npm install @rolldown/binding-linux-x64-gnu --no-save --ignore-scripts

- name: Test
working-directory: ./packages/${{ inputs.package_name }}
shell: bash
Expand Down
46 changes: 21 additions & 25 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ on:
type: boolean
default: false

permissions:
contents: read
packages: write

concurrency:
group: "${{ github.workflow }} @ ${{ github.event.compare || github.head_ref || github.ref }}"
cancel-in-progress: true
Expand All @@ -34,6 +38,7 @@ jobs:
with:
cache: 'npm'
node-version-file: '.nvmrc'
registry-url: https://npm.pkg.github.com
- name: Debug Info
# https://docs.github.com/en/actions/reference/security/secure-use#use-an-intermediate-environment-variable
env:
Expand Down Expand Up @@ -68,8 +73,14 @@ jobs:
fi

- if: ${{ steps.filter.outputs.any-workspace == 'true' }}
env:
NPM_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: ./.github/actions/install-dependencies

- name: Install Rolldown linux binaries
if: ${{ steps.filter.outputs.any-workspace == 'true' }}
run: npm install @rolldown/binding-linux-x64-gnu --no-save --ignore-scripts

# TODO: Packages currently depend on each other's compiled dist at build time. Fix that and matrix the builds.
- name: Build Packages
if: ${{ steps.filter.outputs.any-workspace == 'true' }}
Expand All @@ -86,35 +97,20 @@ jobs:
packages/**/dist
packages/**/playground

- name: Publish scratch-gui to GitHub Packages
if: ${{ github.ref == 'refs/heads/code-classroom' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch') }}
working-directory: ./packages/scratch-gui
env:
NPM_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
RELEASE_VERSION="13.7.3-code-classroom.$(date +'%Y%m%d%H%M%S')"
npm version --no-git-tag-version "$RELEASE_VERSION"
npm publish --access public --tag latest

test:
name: Test
needs: build
if: ${{ needs.build.outputs.any-workspace == 'true' && needs.build.outputs.packages != '[]' }}
uses: ./.github/workflows/test-packages.yml
with:
packages: ${{ needs.build.outputs.packages }}

preview:
name: Preview
needs: build
# We don't want to give forks free reign to publish to our GitHub Pages, so run this job only if both:
# - any workspace changed (otherwise there's no work to do)
# - and either
# - this is not a PR (so it's some other event that happened in our fork, like a push or merge group)
# - or it's a PR from our fork (not some other fork)
# - and
# - it's not a Renovate branch (just to reduce noise)
if: ${{
(needs.build.outputs.any-workspace == 'true') &&
(
(!github.event.pull_request) ||
(github.event.pull_request.head.repo.full_name == github.repository)
) &&
(!startsWith((github.head_ref || github.ref_name), 'renovate/'))
}}
uses: ./.github/workflows/deploy-playground-preview.yml
with:
# even `develop` should be published to a subdirectory
# that way each branch can be updated or cleaned up independently
destination_dir: ${{ github.head_ref || github.ref_name }}
full_commit_message: "Build for ${{ github.sha }} ${{ github.event.head_commit.message }}"
235 changes: 0 additions & 235 deletions .github/workflows/publish.yml

This file was deleted.

38 changes: 0 additions & 38 deletions .github/workflows/signature-assistant.yml

This file was deleted.

22 changes: 0 additions & 22 deletions .github/workflows/test-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,29 +38,7 @@ jobs:
runs-on: ubuntu-latest
needs: test
if: ${{ !cancelled() }}
permissions:
checks: write
pull-requests: write
contents: read
issues: read
steps:
- uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6
with:
# Download every per-package test-output artifact. Each lands
# in its own subdirectory (e.g. scratch-gui-test-output/),
# which avoids filename collisions between packages that both
# produce junit.xml.
pattern: '*-test-output'
path: test-results
- name: Publish test reports
uses: EnricoMi/publish-unit-test-result-action@34d7c956a59aed1bfebf31df77b8de55db9bbaaf # v2
with:
# Every test reporter in this repo produces JUnit XML.
# Restricting to *.xml avoids the action trying to parse
# directories and non-test artifacts (Playwright HTML
# reports, traces, screenshots, etc.) as test result files.
files: test-results/**/*.xml
check_name: "Test Results"
- name: Check test outcome
run: |
case "${{ needs.test.result }}" in
Expand Down
Loading
Loading