mirror of
https://github.com/compiler-explorer/compiler-explorer.git
synced 2026-05-16 17:13:59 -04:00
## Summary Replaces the Python `propscheck.py` validation script with TypeScript code that: - Uses a testable validator module (`lib/properties-validator.ts`) - Has comprehensive unit tests (71 tests in `test/properties-validation-tests.ts`) - Integrates with the existing property loading infrastructure - Runs as part of the normal test suite ## Changes - **New validator module** (`lib/properties-validator.ts`): - Raw file validation: duplicate keys, empty list elements, typos, suspicious paths - Orphan detection: compilers, groups, formatters, tools, libraries - Cross-file duplicate compiler ID detection - Disabled allowlist support (`# Disabled: id1 id2`) - Invalid property format detection (leverages `parseProperties()` with new `collectErrors` option) - Missing compilers list detection for language files - **Property library enhancement** (`lib/properties.ts`): - Added `collectErrors` option to `parseProperties()` for structured error collection - **New npm script**: `npm run test:props` for quick property validation - Set `CHECK_LOCAL_PROPS=true` to include `.local.properties` files - **Updated references**: - CI workflow no longer calls propscheck.py - Pre-commit hook uses `npm run test:props` - CE Properties Wizard uses the new validation - **Removed**: `etc/scripts/util/propscheck.py` and `propschecktest.py` ## Test plan - [x] All 71 unit tests pass - [x] Integration tests validate real config files - [x] `npm run test:props` works standalone - [x] CE Properties Wizard validation works - [x] CI passes 🤖 Generated with [Claude Code](https://claude.ai/code) --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
145 lines
4.4 KiB
YAML
145 lines
4.4 KiB
YAML
name: Compiler Explorer
|
|
|
|
on: [push, pull_request]
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: ubuntu-22.04
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
- name: Use Node.js 22.x
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 22.x
|
|
check-latest: true
|
|
cache: npm
|
|
- name: Install prerequisites
|
|
run: |
|
|
make prereqs
|
|
python3 -m pip install numba
|
|
- name: Install uv
|
|
uses: astral-sh/setup-uv@v6
|
|
- name: Run checks
|
|
run: |
|
|
npm run lint-check
|
|
npm run test -- --coverage
|
|
npm run ts-check
|
|
python3 ./etc/scripts/test_numba_wrapper.py
|
|
uv run --directory etc/scripts/gh_tool pytest -v
|
|
- uses: codecov/codecov-action@v5
|
|
with:
|
|
token: ${{ secrets.CODECOV_TOKEN }}
|
|
verbose: true
|
|
|
|
build_minimum_support:
|
|
runs-on: ubuntu-22.04
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
- name: Use Node.js 20
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 20.18.2
|
|
check-latest: false
|
|
cache: npm
|
|
- name: Install prerequisites
|
|
run: make prereqs
|
|
- name: Run checks
|
|
run: |
|
|
npm run ts-compile
|
|
npm run webpack
|
|
|
|
build_dist:
|
|
if: github.repository_owner == 'compiler-explorer' && github.event_name == 'push'
|
|
runs-on: ubuntu-22.04
|
|
outputs:
|
|
release_name: ${{ steps.build_dist.outputs.release_name }}
|
|
branch: ${{ steps.build_dist.outputs.branch }}
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
- name: Use Node.js 22.x
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 22.x
|
|
check-latest: true
|
|
cache: npm
|
|
- name: Build distribution
|
|
id: build_dist
|
|
run: etc/scripts/build-dist.sh
|
|
- uses: actions/upload-artifact@v4
|
|
with:
|
|
name: dist
|
|
path: out/dist-bin
|
|
|
|
deploy:
|
|
if: github.repository_owner == 'compiler-explorer' && github.event_name == 'push'
|
|
needs: [test, build_dist]
|
|
runs-on: ubuntu-22.04
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
- name: Use Node.js 22.x
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 22.x
|
|
check-latest: true
|
|
cache: npm
|
|
- name: Download the built distribution
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: dist
|
|
path: out/dist-bin
|
|
- name: Unpack static files for sentry
|
|
run: |
|
|
mkdir -p out/dist/static
|
|
tar Jxf out/dist-bin/*.static.tar.xz -C out/dist/static
|
|
- name: Tag in sentry
|
|
run: |
|
|
export SENTRY_AUTH_TOKEN='${{ secrets.SENTRY_AUTH_TOKEN }}'
|
|
export SENTRY_DSN='${{ secrets.SENTRY_DSN }}'
|
|
export SENTRY_ORG=compiler-explorer
|
|
export SENTRY_PROJECT=compiler-explorer
|
|
npm run sentry -- releases new -p compiler-explorer "${{ needs.build_dist.outputs.release_name }}"
|
|
npm run sentry -- releases set-commits --auto "${{ needs.build_dist.outputs.release_name }}"
|
|
npm run sentry -- sourcemaps upload --release "${{ needs.build_dist.outputs.release_name }}" out/dist/static
|
|
- name: Deploy
|
|
uses: jakejarvis/s3-sync-action@master
|
|
with:
|
|
args: --acl public-read --follow-symlinks
|
|
env:
|
|
AWS_S3_BUCKET: compiler-explorer
|
|
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
|
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
|
SOURCE_DIR: out/dist-bin
|
|
DEST_DIR: dist/gh/${{ needs.build_dist.outputs.branch }}
|
|
- name: Tag the commit
|
|
uses: actions/github-script@v7
|
|
with:
|
|
script: |
|
|
github.rest.git.createRef({
|
|
owner: context.repo.owner,
|
|
repo: context.repo.repo,
|
|
ref: `refs/tags/gh-${context.runNumber}`,
|
|
sha: context.sha
|
|
})
|
|
|
|
post_deploy_check:
|
|
needs: [test, build_dist, deploy]
|
|
runs-on: [admin]
|
|
steps:
|
|
- name: Check hashes for deploy ${{ needs.build_dist.outputs.release_name }} to cdn
|
|
run: ce --env staging builds check_hashes ${{ needs.build_dist.outputs.release_name }}
|