Formalize the Vortex type system #131
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| pull_request: | |
| branches: | |
| - develop | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Bun | |
| uses: oven-sh/setup-bun@v2 | |
| - name: Lint all code | |
| run: bunx prettier --check . | |
| build: | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Bun | |
| uses: oven-sh/setup-bun@v2 | |
| - name: Install dependencies | |
| run: bun install | |
| - name: Check RFC number matches PR number | |
| run: | | |
| BASE_SHA="${{ github.event.pull_request.base.sha }}" | |
| HEAD_SHA="${{ github.event.pull_request.head.sha }}" | |
| PR_NUMBER="${{ github.event.pull_request.number }}" | |
| # Grandfathered RFCs that predate the PR number convention | |
| GRANDFATHERED="5 15 23 24 27 29 33" | |
| # Only check newly added RFC files, not moved/renamed ones | |
| CHANGED_RFCS=$(git diff --name-only --diff-filter=A "$BASE_SHA" "$HEAD_SHA" -- 'rfcs/' \ | |
| | grep -v '^rfcs/0000-template\.md$' || true) | |
| COUNT=$(echo "$CHANGED_RFCS" | grep -c . || true) | |
| if [ "$COUNT" -gt 1 ]; then | |
| echo "::error::PR touches $COUNT RFCs. Only one RFC per PR is allowed." | |
| echo "$CHANGED_RFCS" | |
| exit 1 | |
| fi | |
| if [ "$COUNT" -eq 1 ]; then | |
| FILE=$(echo "$CHANGED_RFCS" | head -1) | |
| FILENAME=$(basename "$FILE") | |
| FILE_NUMBER=$(echo "$FILENAME" | grep -oE '^[0-9]+' || true) | |
| # Strip leading zeros for comparison | |
| FILE_NUM=$((10#$FILE_NUMBER)) | |
| # Skip check for grandfathered RFCs | |
| for GF in $GRANDFATHERED; do | |
| if [ "$FILE_NUM" -eq "$GF" ]; then | |
| echo "RFC $FILE_NUM is grandfathered, skipping PR number check." | |
| exit 0 | |
| fi | |
| done | |
| if [ "$FILE_NUM" -ne "$PR_NUMBER" ]; then | |
| echo "::error::RFC number ($FILE_NUM from $FILENAME) does not match PR number ($PR_NUMBER)." | |
| exit 1 | |
| fi | |
| fi | |
| - name: Build | |
| run: bun run build |