diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..ebf4fea --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,42 @@ +name: CI + +# Builds the app and runs the tests on every pull request and on main, on Windows: +# the WinUI 3 app only compiles there. Pull requests from agents (Pullfrog runs on +# Linux and can't build the app) and from forks get the same check before merge. +on: + pull_request: + push: + branches: [main] + workflow_dispatch: + +permissions: + contents: read + +concurrency: + group: ci-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + build: + name: Build and test + runs-on: windows-latest + timeout-minutes: 20 + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: "8.0.x" + + - name: Run tests + shell: pwsh + run: dotnet test tests/ConsoleMode.Tests/ConsoleMode.Tests.csproj -c Release --nologo + + - name: Build the app + shell: pwsh + # Same platform and packaging flags as build/Publish-ConsoleMode.ps1, without publishing. + run: >- + dotnet build src/ConsoleMode/ConsoleMode.csproj -c Release -r win-x64 --nologo + -p:Platform=x64 -p:WindowsPackageType=None -p:WindowsAppSDKSelfContained=true diff --git a/.github/workflows/pullfrog.yml b/.github/workflows/pullfrog.yml index 8b3491b..848c929 100644 --- a/.github/workflows/pullfrog.yml +++ b/.github/workflows/pullfrog.yml @@ -25,10 +25,21 @@ jobs: uses: actions/checkout@v6 with: fetch-depth: 1 + # Console Mode: .NET 8 so the agent can run the unit tests (tests/ConsoleMode.Tests + # targets plain net8.0). The WinUI app itself only builds on Windows: the CI workflow does that. + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: "8.0.x" - name: Run agent uses: pullfrog/pullfrog@v0 with: prompt: ${{ inputs.prompt }} + # Console Mode: feature branches only (no pushes to main, no tag pushes: a v* tag publishes a release). + push: restricted + timeout: 30m + # To use Claude, add ANTHROPIC_API_KEY (Actions secret or Pullfrog console) and uncomment: + # model: anthropic/claude-opus env: # add at least one provider API key ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000..6846c56 --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,41 @@ +# Console Mode: notes for coding agents + +Console Mode is a Windows desktop app (WinUI 3, .NET 8, C#) that turns a PC into a +console: it focuses the TV, hides the other displays, launches Big Picture / Playnite / +Xbox mode, and restores the desk setup afterwards. + +## What you can and cannot verify + +- **The app only builds on Windows.** `src/ConsoleMode` targets `net8.0-windows` with the + Windows App SDK. On Linux (Pullfrog, most cloud agents) do not try to build it; the + **CI** workflow builds it on Windows for every pull request. Say in the PR that the + build was left to CI. +- **The unit tests run anywhere:** + `dotnet test tests/ConsoleMode.Tests/ConsoleMode.Tests.csproj`. + The test project targets plain `net8.0` and compiles a list of pure-logic files from + `src/ConsoleMode` (see its `.csproj`). Run it before every push. When you add logic + that doesn't touch Win32/WinUI, put it in such a file, link it there and test it. +- **Displays, TVs, audio, controllers, windows of other apps** can't be tested in CI. + For changes there, add the manual checks to `docs/TESTING.md` (Portuguese, checklist + style) instead of claiming they work. + +## Layout + +- `src/ConsoleMode/Services`: engine and services (`ConsoleEngine`, `MonitorService`, + `LaunchService`, controllers, updates, localization). +- `src/ConsoleMode/Native`: P/Invoke (Win32, CCD display config). +- `src/ConsoleMode/Views`, `ViewModels`, `Controls`: UI (MVVM with CommunityToolkit.Mvvm). +- `build/`: publish script and Inno Setup installer. `.github/workflows/release.yml` + publishes a release when a `v*` tag is pushed. **Never create or push tags.** + +## Conventions + +- **Every user-facing string** goes in all three catalogs: + `src/ConsoleMode/Resources/Strings.pt-BR.json`, `Strings.en-US.json`, `Strings.es-ES.json`. + The localization tests fail when keys don't match. +- **Changelog**: add user-visible changes under `## [Unreleased]` in both + `CHANGELOG.md` (Portuguese) and `CHANGELOG.en-US.md`, ending the item with the PR number. +- **Docs come in pairs**: `README.md` / `README.pt-BR.md`, `docs/GUIDE.md` / `docs/GUIDE.pt-BR.md`. +- **Commits and PR titles**: Conventional Commits in English (`fix: …`, `feat: …`, `docs: …`), + one topic per PR. `AppLog` messages are written in Portuguese, like the existing ones. +- Keep changes small and focused; don't reformat unrelated code.