Add usaco sync; track saved test outputs
Test and publish the site / test (push) Successful in 4m29s
Test and publish the site / publish (push) Successful in 1m25s

The website commits too, so `usaco sync` pulls its edits before pushing.
tests/*.out were swallowed by the *.out rule; they are expected outputs
the site shows, so re-include them.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
2026-10-14 21:51:34 +01:00
co-authored by Claude Opus 5.5
parent 6d956f1c76
commit 1c647072c5
27 changed files with 64 additions and 6 deletions
+9 -1
View File
@@ -1,17 +1,20 @@
# USACO Workspace
Practice workspace for USACO problems, managed by the `./usaco` script.
The solved problems are also published at https://adam-french.co.uk/usaco/ by the
site in `site/` (see [site/README.md](site/README.md)).
## Layout
```
template.cpp starting template for every problem
site/ the website (Go server + Vue SPA), deployed as its own container
solving/<name>/ problems in progress
solved/<name>/ finished problems
skipped/<name>/ problems set aside for later
```
Each problem dir contains `main.cpp` plus `<io>.in` / `<io>.out` files (USACO file IO is wired up automatically via `STDIO("<io>")`).
Each problem dir contains `main.cpp` plus `<io>.in` / `<io>.out` files (USACO file IO is wired up automatically via `STDIO("<io>")`). Optional extras: `.url` (the problem link), `tests/N.in` + `N.out`, and `notes.md` (shown on the website, usually written from there).
## Commands
@@ -35,10 +38,14 @@ Compiles with `g++ -O2 -std=c++17 -Wall -Wextra` and runs inside the problem dir
### Finish (or give up on) a problem
```
./usaco done diamond-collector # move to solved/ and auto git commit "Solve <name>"
./usaco sync # pull edits made on the website, push your commits
./usaco skip diamond-collector # move to skipped/
./usaco undo diamond-collector # bring back to solving/ from solved/ or skipped/
```
### Website sync
The website commits too: marking a problem solved/skipped, or editing its link or notes there, pushes a commit to Gitea. So `git pull` before you push — `./usaco sync` (alias `sy`) does `git pull --rebase --autostash && git push`. Each push reaches the site within seconds through a Gitea webhook.
### Edit
```
./usaco vim diamond-collector # open main.cpp in $EDITOR (defaults to vim)
@@ -106,4 +113,5 @@ This gives you:
# edit solving/the-lost-cow/main.cpp
./usaco run the-lost-cow # iterate until the output is right
./usaco done the-lost-cow # 🎉 (auto-commits)
./usaco sync # publish it on the website
```