Skip to content

fix: prewarm perl runtime for nightly refresh #918

fix: prewarm perl runtime for nightly refresh

fix: prewarm perl runtime for nightly refresh #918

Workflow file for this run

name: Locutus CI
on:
pull_request:
push:
branches: [main]
tags: ['*']
jobs:
ci:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- uses: actions/setup-node@v6
with:
node-version: 22.x
registry-url: 'https://registry.npmjs.org'
- name: Engine bump guardrail
run: |
node scripts/check-engine-bump.ts
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(corepack yarn config get cacheFolder)" >> $GITHUB_OUTPUT
- uses: actions/cache@v5
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: |
${{ steps.yarn-cache-dir-path.outputs.dir }}
.yarn
website/.yarn
dist/.yarn
.cache
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install Dependencies
run: |
corepack yarn
- name: Install Browser Runtime
run: |
corepack yarn browser:install
- name: Lint
run: |
corepack yarn lint
- name: TypeScript Check
run: |
corepack yarn lint:ts
- name: TypeScript Strict-Next Check
run: |
corepack yarn lint:ts:strict-next
- name: Type Debt Policy Check
run: |
corepack yarn lint:ts:debt:policy
- name: API Signature Snapshot Check
run: |
corepack yarn lint:api:snapshot
- name: Header Format Check
run: |
corepack yarn lint:headers
- name: No Stray JS Check
run: |
corepack yarn lint:no-stray-js
- name: Build
run: |
corepack yarn build
- name: Test
run: |
corepack yarn test
- name: Browser Test
run: |
corepack yarn browser:test
- name: Select parity targets
if: github.event_name == 'pull_request'
id: parity-targets
run: |
corepack yarn select:parity --base-ref origin/${{ github.event.pull_request.base.ref }} --github-output "$GITHUB_OUTPUT"
- name: Upstream surface inventory (selective)
if: github.event_name == 'pull_request' && steps.parity-targets.outputs.upstream_surface_languages != ''
run: |
mapfile -t languages < <(printf '%s\n' "${{ steps.parity-targets.outputs.upstream_surface_languages }}" | sed '/^$/d')
printf 'Running upstream surface inventory checks on %s languages\n' "${#languages[@]}"
printf ' %s\n' "${languages[@]}"
corepack yarn test:upstream-surface "${languages[@]}"
- name: Upstream surface inventory (full)
if: github.event_name != 'pull_request'
run: |
corepack yarn test:upstream-surface
- name: Parity tests (selective)
if: github.event_name == 'pull_request'
run: |
printf '%s\n' "${{ steps.parity-targets.outputs.summary }}"
if [ "${{ steps.parity-targets.outputs.mode }}" = "full" ]; then
corepack yarn test:parity
exit 0
fi
mapfile -t targets < <(printf '%s\n' "${{ steps.parity-targets.outputs.targets }}" | sed '/^$/d')
printf 'Running selective parity on %s targets\n' "${#targets[@]}"
printf ' %s\n' "${targets[@]}"
corepack yarn test:parity "${targets[@]}"
- name: Parity tests (full)
if: github.event_name != 'pull_request'
run: |
corepack yarn test:parity
- name: Upload release artifact
if: startsWith(github.ref, 'refs/tags/')
uses: actions/upload-artifact@v4
with:
name: dist
path: dist
if-no-files-found: error
- name: Prepare release notes artifact
if: startsWith(github.ref, 'refs/tags/')
run: |
node scripts/extract-release-notes.ts --version "${GITHUB_REF_NAME}" > release-notes.md
- name: Upload release notes artifact
if: startsWith(github.ref, 'refs/tags/')
uses: actions/upload-artifact@v4
with:
name: release-notes
path: release-notes.md
if-no-files-found: error
- name: Website Build
if: github.event_name == 'pull_request' || github.ref == 'refs/heads/main'
run: |
corepack yarn website:ci
- name: Upload website artifact
if: github.ref == 'refs/heads/main'
uses: actions/upload-artifact@v4
with:
name: website-public
path: website/public
if-no-files-found: error
release:
if: startsWith(github.ref, 'refs/tags/')
needs: ci
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
steps:
- uses: actions/setup-node@v6
with:
node-version: 22.x
registry-url: 'https://registry.npmjs.org'
- uses: actions/download-artifact@v4
with:
name: dist
path: dist
- uses: actions/download-artifact@v4
with:
name: release-notes
path: .
- name: Publish package and create GitHub release
env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
run: |
PACKAGE_NAME=$(node -p "require('./dist/package.json').name")
PACKAGE_VERSION=$(node -p "require('./dist/package.json').version")
EXPECTED_TAG="v${PACKAGE_VERSION}"
if [ "$EXPECTED_TAG" != "${GITHUB_REF_NAME}" ]; then
echo "Tag/version mismatch: expected $EXPECTED_TAG from dist/package.json, got ${GITHUB_REF_NAME}" >&2
exit 1
fi
npm install -g npm@^11.5.1
SHOULD_CREATE_GITHUB_RELEASE=0
if gh release view "${GITHUB_REF_NAME}" >/dev/null 2>&1; then
echo "GitHub release already exists: ${GITHUB_REF_NAME}"
else
SHOULD_CREATE_GITHUB_RELEASE=1
fi
if npm view "${PACKAGE_NAME}@${PACKAGE_VERSION}" version >/dev/null 2>&1; then
echo "npm package already published: ${PACKAGE_NAME}@${PACKAGE_VERSION}"
else
cd dist/
npm publish --access public --provenance
cd ..
fi
if [ "$SHOULD_CREATE_GITHUB_RELEASE" = "1" ]; then
gh release create "${GITHUB_REF_NAME}" --title "${GITHUB_REF_NAME}" --notes-file release-notes.md
fi
website-deploy:
if: github.ref == 'refs/heads/main'
needs: ci
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- uses: actions/download-artifact@v4
with:
name: website-public
path: website/public
- name: Website Deploy 🚀
run: |
./scripts/deploy-gh-pages.sh