Skip to content

revert: full rollback of Phase 4 bootstrap to Phase 1 known-good #14

revert: full rollback of Phase 4 bootstrap to Phase 1 known-good

revert: full rollback of Phase 4 bootstrap to Phase 1 known-good #14

Workflow file for this run

name: PR automations
on:
pull_request:
jobs:
lint-code:
name: Lint code
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Cache dependencies
uses: actions/cache@v4
with:
path: '**/node_modules'
key: ec2-github-runner-${{ hashFiles('**/package-lock.json') }}
- name: Install packages
run: npm install
- name: Run linter
run: npm run lint
verify-dist:
name: Verify dist is up to date
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- name: Install packages
run: npm ci
- name: Rebuild dist
run: npm run package
- name: Fail if dist/ differs from committed copy
# ncc 0.38 produces code-split chunks alongside dist/index.js
# (e.g. dist/136.index.js); the whole dist/ tree must stay in
# sync with src/.
run: |
if ! git diff --quiet -- dist/ || [ -n "$(git status --porcelain -- dist/)" ]; then
echo "::error::dist/ is out of sync with src/."
echo "::error::Run 'npm run package' locally and commit the rebuilt dist/."
git status --porcelain -- dist/
git diff --stat -- dist/
exit 1
fi
unit-tests:
name: Unit tests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- name: Install packages
run: npm ci
- name: Run jest
run: npm test
verify-runner-url:
name: Verify pinned actions/runner release exists
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Extract runner version from src/aws.js
id: extract
run: |
version=$(grep -oE 'actions/runner/releases/download/v[0-9]+\.[0-9]+\.[0-9]+' src/aws.js | head -1 | sed 's|.*/v||')
if [ -z "$version" ]; then
echo "::error::Could not locate the pinned actions/runner version in src/aws.js"
exit 1
fi
echo "version=$version" >> "$GITHUB_OUTPUT"
echo "Pinned actions/runner: v$version"
- name: HEAD check the Linux x64 release asset
env:
VERSION: ${{ steps.extract.outputs.version }}
run: |
url="https://github.com/actions/runner/releases/download/v${VERSION}/actions-runner-linux-x64-${VERSION}.tar.gz"
echo "Checking $url"
curl -fsSLI -o /dev/null "$url"