diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 15c3ad8..9303f02 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,10 +15,26 @@ name: CI -# >>> TASK 6: add the triggers (push + pull_request on main) on: -# <<< END TASK 6 + push: + branches: [main] + pull_request: + branches: [main] -# >>> TASK 7: add a `test` job that runs on ubuntu-latest with the four steps jobs: -# <<< END TASK 7 + test: + runs-on: ubuntu-latest + steps: + - name: Check out the code + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.12" + + - name: Install dependencies + run: pip install -r requirements.txt + + - name: Run the full test suite + run: pytest -q \ No newline at end of file diff --git a/TASKS.md b/TASKS.md index 9d02bf1..1da20a7 100644 --- a/TASKS.md +++ b/TASKS.md @@ -34,16 +34,16 @@ Your job is to turn every red one green without breaking a green one. Files: `app/static/index.html` and `app/static/styles.css` Check with: `pytest tests/test_accessibility.py tests/test_performance.py` -- [ ] **TASK 1 — Perceivable.** Add `lang` to ``, a real ``, and +- [x] **TASK 1 — Perceivable.** Add `lang` to `<html>`, a real `<title>`, and `alt` text on both images. -- [ ] **TASK 2 — Structure & controls.** Make the content a `<main>` landmark, +- [x] **TASK 2 — Structure & controls.** Make the content a `<main>` landmark, fix the heading levels so they don't skip (h1 → h2, not h1 → h3), and turn the fake `<div class="btn">` into a real `<button>`. -- [ ] **TASK 3 — Labels.** Replace the `<span class="fake-label">` text with real +- [x] **TASK 3 — Labels.** Replace the `<span class="fake-label">` text with real `<label for="...">` tied to each input's `id`. -- [ ] **TASK 4 — Contrast.** In `styles.css`, darken `--ink` and `--brand` until +- [x] **TASK 4 — Contrast.** In `styles.css`, darken `--ink` and `--brand` until both contrast tests pass (WCAG AA = 4.5:1). -- [ ] **TASK 5 — Performance.** `defer` the script, add `width`/`height` to both +- [x] **TASK 5 — Performance.** `defer` the script, add `width`/`height` to both images, and `loading="lazy"` to the content image. ## Part B — Ship it on a pipeline (Week 17) @@ -51,8 +51,8 @@ Check with: `pytest tests/test_accessibility.py tests/test_performance.py` File: `.github/workflows/ci.yml` Check with: `pytest tests/test_pipeline.py` -- [ ] **TASK 6 — Triggers.** Run the workflow on `push` and `pull_request` to `main`. -- [ ] **TASK 7 — The job.** One `test` job on `ubuntu-latest` that checks out the +- [x] **TASK 6 — Triggers.** Run the workflow on `push` and `pull_request` to `main`. +- [x] **TASK 7 — The job.** One `test` job on `ubuntu-latest` that checks out the code, sets up Python, installs `requirements.txt`, and runs `pytest`. When all three suites pass locally, run the whole thing once more: diff --git a/app/static/index.html b/app/static/index.html index dea88a2..5634cbe 100644 --- a/app/static/index.html +++ b/app/static/index.html @@ -8,21 +8,21 @@ to see red turn green. The handout explains the "why" behind each task. --> <!-- >>> TASK 1a: give the page a language (WCAG 3.1.1) --> -<html> +<html lang="en"> <!-- <<< END TASK 1a --> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <!-- >>> TASK 1b: give the page a real, descriptive <title> (WCAG 2.4.2) --> - <title> + SecureNotes — Your notes, kept private - + @@ -33,7 +33,7 @@ - + SecureNotes logo SecureNotes @@ -46,7 +46,7 @@ -
+

Your notes, kept private

@@ -54,8 +54,8 @@

Your notes, kept private

-

Log in

+ Fix the section headings so levels don't skip (WCAG 1.3.1). --> +

Log in

@@ -63,19 +63,19 @@

Log in

-

My notes

+

My notes

  • Log in to load your notes.
-

Why SecureNotes

+

Why SecureNotes

Passwords are hashed, every note is tied to its owner, and the whole app is checked automatically before each release.

- + and loading="lazy" (TASK 5c). --> + A padlock resting on a stack of notes
-
+