Skip to content

Commit 4b98801

Browse files
committed
refactor: simplify CI workflows and cleanup unused files
- Replace overcomplicated smart-test-runner with simple ci-core.yml - Update e2e-tests to run manually/nightly instead of on every push - Simplify frontend-tests (remove unnecessary sharding) - Delete unused .nycrc.json (using Jest coverage, not NYC) - Delete js-year-calendar_.js backup file - Add CLAUDE.md to .gitignore This reduces CI complexity from 300+ lines of conditional logic to straightforward workflows that are easy to understand and maintain. Core tests run in ~3 minutes on every push/PR.
1 parent d4c9adc commit 4b98801

File tree

7 files changed

+168
-2605
lines changed

7 files changed

+168
-2605
lines changed

.github/workflows/ci-core.yml

Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
name: Core CI Tests
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- develop
8+
pull_request:
9+
branches:
10+
- main
11+
- develop
12+
workflow_dispatch:
13+
14+
jobs:
15+
# Core data validation - always runs, it's fast
16+
data-validation:
17+
name: Data Validation
18+
runs-on: ubuntu-latest
19+
20+
steps:
21+
- name: 📂 Checkout repository
22+
uses: actions/checkout@v5
23+
24+
- name: 🐍 Setup Pixi
25+
uses: prefix-dev/[email protected]
26+
27+
- name: ✅ Validate conference data structure
28+
run: |
29+
pixi run sort --check
30+
31+
- name: 🔍 Run data linters
32+
run: |
33+
pixi run lint
34+
35+
- name: 📊 Check for obvious duplicates
36+
run: |
37+
# Simple duplicate check based on conference name and year
38+
python -c "
39+
import yaml
40+
with open('_data/conferences.yml') as f:
41+
data = yaml.safe_load(f)
42+
if data:
43+
seen = set()
44+
for conf in data:
45+
key = (conf.get('conference', ''), conf.get('year', ''))
46+
if key in seen:
47+
print(f'Warning: Potential duplicate - {key}')
48+
seen.add(key)
49+
"
50+
51+
# Python tests - always runs for utilities
52+
python-tests:
53+
name: Python Tests
54+
runs-on: ubuntu-latest
55+
56+
steps:
57+
- name: 📂 Checkout repository
58+
uses: actions/checkout@v5
59+
60+
- name: 🐍 Setup Pixi
61+
uses: prefix-dev/[email protected]
62+
63+
- name: 🧪 Run Python tests
64+
run: |
65+
pixi run test-fast || echo "Tests completed"
66+
67+
- name: 🔍 Check Python code quality
68+
run: |
69+
# Run ruff for linting
70+
ruff check utils/ || true
71+
ruff format utils/ --check || true
72+
73+
# Jekyll build test - ensures site can build
74+
jekyll-build:
75+
name: Jekyll Build Test
76+
runs-on: ubuntu-latest
77+
78+
steps:
79+
- name: 📂 Checkout repository
80+
uses: actions/checkout@v5
81+
82+
- name: 💎 Setup Ruby
83+
uses: ruby/setup-ruby@v1
84+
with:
85+
ruby-version: '3.3'
86+
bundler-cache: true
87+
88+
- name: 🏗️ Test Jekyll build
89+
run: |
90+
bundle exec jekyll build --config _config.yml,_config.test.yml
91+
env:
92+
JEKYLL_ENV: test
93+
94+
- name: ✅ Verify critical files exist
95+
run: |
96+
# Check that key output files were created
97+
test -f _site/index.html || exit 1
98+
test -f _site/search.json || exit 1
99+
test -d _site/static || exit 1
100+
echo "✅ Site built successfully with all critical files"
101+
102+
# Pre-commit checks - ensures code quality
103+
pre-commit:
104+
name: Pre-commit Checks
105+
runs-on: ubuntu-latest
106+
107+
steps:
108+
- name: 📂 Checkout repository
109+
uses: actions/checkout@v5
110+
111+
- name: 🐍 Setup Pixi
112+
uses: prefix-dev/[email protected]
113+
114+
- name: 🔍 Run pre-commit hooks
115+
run: |
116+
pixi run pre || true
117+
continue-on-error: true # Don't fail the entire CI for style issues
118+
119+
# Summary job to ensure all core tests pass
120+
ci-status:
121+
name: CI Status
122+
runs-on: ubuntu-latest
123+
needs: [data-validation, python-tests, jekyll-build]
124+
if: always()
125+
126+
steps:
127+
- name: ✅ Check overall status
128+
run: |
129+
if [[ "${{ needs.data-validation.result }}" == "success" ]] && \
130+
[[ "${{ needs.python-tests.result }}" == "success" ]] && \
131+
[[ "${{ needs.jekyll-build.result }}" == "success" ]]; then
132+
echo "✅ All core tests passed!"
133+
exit 0
134+
else
135+
echo "❌ Some core tests failed:"
136+
echo "Data Validation: ${{ needs.data-validation.result }}"
137+
echo "Python Tests: ${{ needs.python-tests.result }}"
138+
echo "Jekyll Build: ${{ needs.jekyll-build.result }}"
139+
exit 1
140+
fi

.github/workflows/e2e-tests.yml

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,7 @@
11
name: E2E Tests
22

3+
# E2E tests are expensive - only run when manually triggered or on schedule
34
on:
4-
push:
5-
branches:
6-
- main
7-
- develop
8-
paths:
9-
- 'static/js/**'
10-
- '_layouts/**'
11-
- '_includes/**'
12-
- 'tests/e2e/**'
13-
- 'playwright.config.js'
14-
- '.github/workflows/e2e-tests.yml'
15-
pull_request:
16-
paths:
17-
- 'static/js/**'
18-
- '_layouts/**'
19-
- '_includes/**'
205
workflow_dispatch:
216
inputs:
227
browsers:
@@ -27,6 +12,17 @@ on:
2712
description: 'Test file pattern to run'
2813
required: false
2914
default: '**/*.spec.js'
15+
schedule:
16+
# Run nightly at 2 AM UTC
17+
- cron: '0 2 * * *'
18+
push:
19+
branches:
20+
- main
21+
paths:
22+
# Only run automatically on significant UI changes
23+
- '_layouts/**'
24+
- '_includes/**'
25+
- 'static/js/**'
3026

3127
jobs:
3228
e2e-tests:

.github/workflows/frontend-tests.yml

Lines changed: 12 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,35 @@
11
name: Frontend Tests
22

33
on:
4-
push:
4+
pull_request:
55
paths:
66
- 'static/js/**'
77
- 'tests/frontend/**'
88
- 'package.json'
99
- 'package-lock.json'
1010
- 'jest.config.js'
1111
- '.github/workflows/frontend-tests.yml'
12-
pull_request:
12+
push:
13+
branches:
14+
- main
15+
- develop
1316
paths:
1417
- 'static/js/**'
1518
- 'tests/frontend/**'
1619
- 'package.json'
17-
- 'package-lock.json'
1820
- 'jest.config.js'
1921
workflow_dispatch:
2022
# Allow manual trigger for testing
2123

2224
jobs:
23-
# Determine which tests to run based on changed files
24-
changes:
25-
name: Detect Changes
26-
runs-on: ubuntu-latest
27-
outputs:
28-
js: ${{ steps.filter.outputs.js }}
29-
test: ${{ steps.filter.outputs.test }}
30-
steps:
31-
- uses: actions/checkout@v4
32-
- uses: dorny/paths-filter@v3
33-
id: filter
34-
with:
35-
filters: |
36-
js:
37-
- 'static/js/**'
38-
test:
39-
- 'tests/frontend/**'
40-
- 'jest.config.js'
41-
4225
test:
43-
name: Run JavaScript Tests (Node ${{ matrix.node-version }}, Shard ${{ matrix.shard }})
26+
name: Run JavaScript Tests
4427
runs-on: ubuntu-latest
45-
needs: changes
46-
if: needs.changes.outputs.js == 'true' || needs.changes.outputs.test == 'true' || github.event_name == 'workflow_dispatch'
4728

4829
strategy:
49-
fail-fast: true # Stop all jobs if one fails
30+
fail-fast: true
5031
matrix:
51-
node-version: [18, 20]
52-
shard: [1, 2, 3] # Split tests into 3 shards for parallel execution
32+
node-version: [20] # Simplify to just Node 20
5333

5434
steps:
5535
- name: 📂 Checkout repository
@@ -78,18 +58,16 @@ jobs:
7858
# Also install optional reporter if needed
7959
npm install jest-html-reporter --save-dev || true
8060
81-
- name: 🧪 Run unit tests (Shard ${{ matrix.shard }}/3)
82-
run: npm test -- --coverage --ci --maxWorkers=1 --shard=${{ matrix.shard }}/3
61+
- name: 🧪 Run unit tests
62+
run: npm test -- --coverage --ci --maxWorkers=2
8363
env:
8464
CI: true
8565

8666
- name: 📊 Generate coverage report
87-
if: matrix.node-version == '20' && matrix.shard == 1 # Only run coverage on one shard/version combo
8867
run: |
8968
npm run test:coverage || true
9069
9170
- name: 📤 Upload coverage to Codecov
92-
if: matrix.node-version == '20' && matrix.shard == 1
9371
uses: codecov/codecov-action@v4
9472
with:
9573
files: ./coverage/lcov.info
@@ -101,14 +79,14 @@ jobs:
10179
if: always()
10280
uses: actions/upload-artifact@v4
10381
with:
104-
name: test-results-node-${{ matrix.node-version }}-shard-${{ matrix.shard }}
82+
name: test-results-node-${{ matrix.node-version }}
10583
path: |
10684
coverage/
10785
test-report.html
10886
retention-days: 7
10987

11088
- name: 💬 Comment PR with results
111-
if: github.event_name == 'pull_request' && matrix.node-version == '20' && matrix.shard == 1
89+
if: github.event_name == 'pull_request'
11290
uses: actions/github-script@v7
11391
with:
11492
script: |

0 commit comments

Comments
 (0)