From 4aab4087dc97906d0b9890035401175cdaab32d4 Mon Sep 17 00:00:00 2001 From: blackhao <13851610112@163.com> Date: Fri, 22 Aug 2025 02:51:50 -0500 Subject: 2.0 --- .github/workflows/build-dataset.yml | 70 +++++++++++++++++++++++++++++++++ .github/workflows/update-and-deploy.yml | 34 ---------------- 2 files changed, 70 insertions(+), 34 deletions(-) create mode 100644 .github/workflows/build-dataset.yml delete mode 100644 .github/workflows/update-and-deploy.yml (limited to '.github') diff --git a/.github/workflows/build-dataset.yml b/.github/workflows/build-dataset.yml new file mode 100644 index 0000000..103000b --- /dev/null +++ b/.github/workflows/build-dataset.yml @@ -0,0 +1,70 @@ +name: Build UIUC Course Dataset + +on: + workflow_dispatch: + inputs: + year: + description: "Catalog year (e.g., 2024)" + required: false + default: "2024" + term: + description: "Term (fall|spring|summer|winter)" + required: false + default: "fall" + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.12' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + + - name: Fetch catalog -> data/courses.json + run: | + mkdir -p data + python scripts/fetch_uiuc_courses.py --year "${{ github.event.inputs.year }}" --term "${{ github.event.inputs.term }}" --output data/courses.json + + - name: Analyze prerequisites + run: | + python scripts/analyze_prereqs.py data/courses.json --outdir data/analysis + + - name: Parse course-only prerequisites + run: | + mkdir -p data/parsed + python scripts/parse_course_prereqs.py data/analysis/course_only.json --output data/parsed/course_only_parsed.json --unparsed-output data/parsed/course_only_unparsed.json + + - name: Build final parsed dataset + run: | + python scripts/build_final_parsed.py data/courses.json --output data/courses_parsed.json + + - name: Upload raw courses + uses: actions/upload-artifact@v4 + with: + name: courses-json + path: data/courses.json + + - name: Upload analysis + uses: actions/upload-artifact@v4 + with: + name: analysis-json + path: data/analysis + + - name: Upload parsed outputs + uses: actions/upload-artifact@v4 + with: + name: parsed-json + path: | + data/parsed + data/courses_parsed.json + + diff --git a/.github/workflows/update-and-deploy.yml b/.github/workflows/update-and-deploy.yml deleted file mode 100644 index fb034a6..0000000 --- a/.github/workflows/update-and-deploy.yml +++ /dev/null @@ -1,34 +0,0 @@ -name: grab-data-build-deploy - -on: - schedule: - - cron: "0 6 * * *" - push: - branches: [main] - -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 - with: - node-version: 18 - - run: npm ci - - name: Scrape UIUC catalog - env: - NODE_OPTIONS: --dns-result-order=ipv4first - run: npm run scrape - - name: Commit data - run: | - git config user.name "gh-bot" - git config user.email "bot@users.noreply.github.com" - git add data || true - git diff --cached --quiet || git commit -m "auto: update catalog" - - run: git push - - run: npm run build - - name: Deploy - uses: peaceiris/actions-gh-pages@v4 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ./dist -- cgit v1.2.3