P6DF Build Action
Composite GitHub Action that builds and tests `p6df-` plugins by installing prerequisites, resolving module dependencies from `p6common`, and executing tests.
What This Action Does
1. Installs `zsh` and `time` packages on Ubuntu runners
2. Checks out `p6m7g8-dotfiles/p6common` into `./p6common`
3. Resolves module dependencies for the current `p6df-<module>` repository
4. Runs `p6common/bin/p6ctl test` under `zsh -e`
Project Structure
**Key Files:**
`action.yml` - Composite Action definition (install → checkout → deps → test)`.github/workflows/build.yml` - Required CI check (triggers on PR, merge_group, manual)`.github/workflows/auto-queue.yml` - Auto-enqueue to Merge Queue after Build success`.github/workflows/auto-approve.yml` - Auto-approve for trusted authors/labels`.github/workflows/pr-labeler.yml` - Auto-label PRs with 'contribution/core' and 'auto-merge'`.github/workflows/pull-request-lint.yml` - Enforce Conventional Commit PR titlesBuild & Test Instructions
Prerequisites
```bash
sudo apt-get update && sudo apt-get install -y zsh time
```
Local Test Reproduction
From a `p6df-<module>` repository checkout:
```bash
Clone p6common dependency
git clone https://github.com/p6m7g8-dotfiles/p6common ./p6common
Resolve module dependencies
zsh -c '. ./p6common/init.zsh; p6df::modules::p6common::gha::ModuleDeps "$(basename "$GITHUB_REPOSITORY" | cut -d- -f2)"'
Run tests exactly as CI does
P6_DFZ_SRC_P6M7G8_DOTFILES_DIR=. TERM=xterm zsh -e p6common/bin/p6ctl test
```
**Exit code 0** = success; **non-zero** = test failure
Action Usage
Consumer workflows invoke with:
```yaml
uses: p6m7g8-actions/p6df-build@<ref>```
No inputs required.
CI Gates Before Merge
**Build / build** - Required status check (must pass for Merge Queue)**PR title lint** - Requires Conventional Commit type: `chore|ci|docs|feat|fix|major|perf|refactor|revert|style|test`**Labeler & Auto-approve** - Auto-labels and approves based on author/labels**Auto-queue** - Adds PR to Merge Queue after successful Build**Critical:** Keep workflow name `Build` and job id `build`. Enable triggers for both `pull_request` and `merge_group`.
Action Execution Sequence
1. `actions/checkout@v5` (current repo)
2. Install packages: `apt-get install time zsh`
3. Checkout `p6m7g8-dotfiles/p6common` → `./p6common`
4. Resolve dependencies:
```bash
zsh -c ". ./p6common/init.zsh; p6df::modules::p6common::gha::ModuleDeps $mod"
```
where `$mod` is extracted from `GITHUB_REPOSITORY` name (`p6df-<module>`)
5. Execute tests:
```bash
P6_DFZ_SRC_P6M7G8_DOTFILES_DIR=. TERM=xterm zsh -e p6common/bin/p6ctl test
```
Dependencies & Assumptions
**Runtime:** `ubuntu-latest` GitHub-hosted runners**Languages:** YAML + Bash/Zsh**Network access required** to fetch `p6common` repository**Naming convention:** Repository must follow `p6df-<module>` pattern**External functions:** Relies on `p6df::modules::p6common::gha::ModuleDeps` from `p6common`Common Pitfalls & Mitigations
**Missing zsh:** Always install via `apt-get` before running tests**Dependency resolution fails:** Ensure `p6common` exists at `./p6common` and `. ./p6common/init.zsh` succeeds**Interactive shell issues:** CI sets `TERM=xterm`; preserve this for local testingAgent Guidelines
Trust this documentation first; search only when incomplete or incorrectPreserve workflow names, triggers, and ordering for downstream dependenciesKeep steps idempotent and fast; avoid long-lived processesPrefer `bash` for inline steps but ensure `zsh` compatibility for testsWhen editing `action.yml`, maintain the install → checkout → deps → test sequenceNo linters configured; keep YAML 1.2 valid and shell scripts `shellcheck`-clean