From 0f07396ee5379b50b34dcfdec71d27277b31beaf Mon Sep 17 00:00:00 2001 From: Tony Spataro Date: Sat, 26 Jul 2025 17:30:15 -0700 Subject: [PATCH 1/3] Add CI workflow --- .github/workflows/ci.yml | 93 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..feb1a69 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,93 @@ +name: CI + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' + cache: 'npm' + + - name: Install dependencies + run: npm ci + + - name: Build + run: npm run build + + - name: Upload build artifacts + uses: actions/upload-artifact@v4 + with: + name: dist + path: dist/ + + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' + cache: 'npm' + + - name: Install dependencies + run: npm ci + + - name: Lint + run: npm run lint + + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' + cache: 'npm' + + - name: Install dependencies + run: npm ci + + - name: Test + run: npm run test + + verify-build: + runs-on: ubuntu-latest + needs: build + steps: + - uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' + cache: 'npm' + + - name: Install dependencies + run: npm ci + + - name: Build + run: npm run build + + - name: Verify no changes to built output + run: | + if [ -n "$(git status --porcelain dist/)" ]; then + echo "::error::Built output has uncommitted changes. Please run 'npm run build' and commit the changes." + git diff dist/ + exit 1 + else + echo "✅ Built output is up-to-date" + fi From 4b74b2a624b2e9368a3d632ea87766d926d5017a Mon Sep 17 00:00:00 2001 From: Tony Spataro Date: Sat, 26 Jul 2025 17:41:18 -0700 Subject: [PATCH 2/3] Add a self-test workflow --- .github/workflows/pull-request.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .github/workflows/pull-request.yml diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml new file mode 100644 index 0000000..2ba12fc --- /dev/null +++ b/.github/workflows/pull-request.yml @@ -0,0 +1,25 @@ +name: Pull Request Status + +on: + pull_request: + types: [opened, synchronize, reopened] + +jobs: + update-status: + runs-on: ubuntu-latest + name: Check if changed files are exempt + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Diff Status Action + uses: ./ + with: + token: ${{ secrets.GITHUB_TOKEN }} + globs: | + **/*.md + statuses: | + build + lint + test + verify-build From 5ba3444d60f0887e298991714c9a877a4068d7d3 Mon Sep 17 00:00:00 2001 From: Tony Spataro Date: Sat, 26 Jul 2025 17:45:36 -0700 Subject: [PATCH 3/3] Remove useless names --- .github/workflows/ci.yml | 2 -- .github/workflows/pull-request.yml | 3 --- 2 files changed, 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index feb1a69..7c683c8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,5 +1,3 @@ -name: CI - on: push: branches: [ main ] diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 2ba12fc..cc70ff6 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -1,5 +1,3 @@ -name: Pull Request Status - on: pull_request: types: [opened, synchronize, reopened] @@ -7,7 +5,6 @@ on: jobs: update-status: runs-on: ubuntu-latest - name: Check if changed files are exempt steps: - name: Checkout repository uses: actions/checkout@v4