Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
// Dev container for the Forge SWEXP starter repo.
// Open in GitHub Codespaces (Code -> Codespaces -> Create) or VS Code Dev Containers
// for a zero-setup environment with Git, the right runtime, and the gh CLI preinstalled.
// Then follow README.md / Lesson_00.md to pick up your first ticket.
// Then follow README.md to pick up your first lab.
{
"name": "SWEXP 08 Platform Engineering Containerization",
"image": "mcr.microsoft.com/devcontainers/base:ubuntu",
"features": {
"ghcr.io/devcontainers/features/node:1": {
"version": "20"
},
"ghcr.io/devcontainers/features/python:1": {
"version": "3.12"
},
"ghcr.io/devcontainers/features/docker-in-docker:2": {},
"ghcr.io/devcontainers/features/github-cli:1": {}
},
"postCreateCommand": "echo '\\n=== Forge SWEXP environment ready ==='; git --version; node --version 2>/dev/null; echo 'Open README.md, then Lesson_00.md to begin.'",
"postCreateCommand": "npm install; python3 -c 'import yaml' 2>/dev/null || pip install --quiet pyyaml; echo '\\n=== Forge SWEXP environment ready ==='; git --version; node --version 2>/dev/null; python3 --version 2>/dev/null; docker --version 2>/dev/null; echo 'Open README.md, then start with labs/lab-00-setup.'",
"customizations": {
"vscode": {
"extensions": [
Expand Down
63 changes: 63 additions & 0 deletions .github/workflows/autograde.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Autograde

on:
push:
branches: ["**"]
pull_request:
workflow_dispatch:

permissions:
contents: read
pull-requests: write

jobs:
grade:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: "20"
cache: "npm"

- name: Install dependencies (bats)
run: npm ci

- name: Ensure PyYAML (compose/CI/k8s YAML graders parse with python3)
run: python3 -c "import yaml" || pip install --quiet pyyaml

- name: Run autograder
id: grade
continue-on-error: true
run: npm run grade

- name: Publish score to job summary
if: always()
run: cat grade-report.md >> "$GITHUB_STEP_SUMMARY" || true

- name: Comment score on pull request
if: always() && github.event_name == 'pull_request'
uses: actions/github-script@v7
with:
script: |
const fs = require('fs');
const marker = '<!-- swexp-autograde -->';
let body = marker + '\n';
try { body += fs.readFileSync('grade-report.md', 'utf8'); }
catch { body += 'Autograder did not produce a report.'; }
const { owner, repo } = context.repo;
const issue_number = context.issue.number;
const { data: comments } = await github.rest.issues.listComments({ owner, repo, issue_number });
const existing = comments.find(c => c.body && c.body.includes(marker));
if (existing) {
await github.rest.issues.updateComment({ owner, repo, comment_id: existing.id, body });
} else {
await github.rest.issues.createComment({ owner, repo, issue_number, body });
}

- name: Fail the check if incomplete
if: steps.grade.outcome != 'success'
run: |
echo "Exercises are not yet complete — see the autograde summary above."
exit 1
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
.DS_Store
node_modules/
.grade/
grade-report.md
errors.log
39 changes: 0 additions & 39 deletions LEARNER_GUIDE.md

This file was deleted.

105 changes: 0 additions & 105 deletions Lesson_00.md

This file was deleted.

102 changes: 0 additions & 102 deletions Lesson_01.md

This file was deleted.

Loading
Loading