2.8 KiB
2.8 KiB
Ticket 0006: ci-feature.yml (reusable workflow)
Vaihe: 6/12
Status: pending
Feature branch: feature/0006-ci-feature-yml
TDD required: Yes
Feature file required: Yes
Required context:
docs/test-plan/tdd-guide.mdtests/features/0006-ci-feature.feature- Skills:
tdd,implementation,clean-code
TDD — Red-Green-Refactor + Dogfood
Red
Ennen workflow'ta, kirjoita validointitestit (tests/workflows.bats):
- YAML-skeema: kaikki vaaditut
inputsmääritelty concurrency-ryhmä estää rinnakkaiset ajotuses:-viittaukset oikeisiin skripteihin
bats tests/workflows.bats
# FAIL: workflow-tiedostoa ei ole
Green
Toteuta gitea/workflows/ci-feature.yml.
bats tests/workflows.bats
# PASS: YAML validi, skeema täsmää
Dogfood
Lisää kutsu gitea/workflows/ci.yml:stä:
feature:
if: github.ref != 'refs/heads/master'
uses: ./gitea/workflows/ci-feature.yml@main
Jokainen push feature-branchiin ajaa ci-feature.yml:n.
DoD
- Cucumber:
@ticket-0006 and @mock→ kaikki skenaariot GREEN tests/workflows.bats— YAML-validointi läpi- Kaikki stepit määritelty: start → unit-test → code-coverage → publish-html → end
concurrencyestää rinnakkaiset ajot samalle branchille- Dogfood: kirjaston oma CI käyttää tätä workflow'ta
- Statusviestit raportoivat jokaisen stepin tilan
Toiminto
Feature-branchin CI-workflow. Kutsuu report-status.sh ja push-reports.sh (Ticket 0001 ja 0003).
Trigger
workflow_call (reusable workflow)
Inputs
| Parametri | Pakollinen | Kuvaus |
|---|---|---|
config-file |
Kyllä | Polku ci-flow-values.yaml:aan |
maven-image |
Ei | Maven-kontti (esim. maven:3.9-eclipse-temurin-21) |
node-image |
Ei | Node-kontti (npm-projektit) |
Steppit
start → unit-test → code-coverage → publish-html → end
| Steppi | Skripti | Status |
|---|---|---|
start |
report-status.sh pending "Building..." |
INPROGRESS |
unit-test |
Projektin oma testiajo | — |
code-coverage |
JaCoCo / vastaava | — |
publish-html |
push-reports.sh cucumber; push-reports.sh jacoco |
— |
end |
report-status.sh success/failure |
Lopullinen status |
fail (catch) |
report-status.sh failure |
FAILURE |
Concurrency
concurrency:
group: feature-${{ github.ref }}
cancel-in-progress: false
Verifiointi
Simuloi paikallisesti (act-runner tai manuaalinen steppien ajo):
report-status.sh pending→ commitin status = pending- Testit ajetaan
push-reports.sh→ raportit MinIO:ssareport-status.sh success→ statusviesti + URL
Viitteet
docs/workflows.md—ci-feature.yml— Feature-branchdocs/architecture.md— Järjestelmäkaavio