commit status ohje
This commit is contained in:
@@ -202,7 +202,16 @@ jobs:
|
||||
|
||||
- name: Report
|
||||
if: always()
|
||||
run: bash .ci/scripts/ci-report.sh "<kuvaus>" <context> <suite> ${{ job.status }}
|
||||
run: |
|
||||
bash .ci/scripts/ci-report.sh "<Test type> test report" <context> <suite> ${{ job.status }}
|
||||
```
|
||||
|
||||
Monorepossa context ja description sisältävät komponentin nimen:
|
||||
```yaml
|
||||
- name: Report
|
||||
if: always()
|
||||
run: |
|
||||
bash .ci/scripts/ci-report.sh "<Komponentti>: <Test type> test report" <komponentti>.<context> <suite> ${{ job.status }}
|
||||
```
|
||||
|
||||
**Usean runnerin cache-ongelma:** Jos eri kerroilla käynnistyy eri runnereita,
|
||||
@@ -218,6 +227,7 @@ niillä voi olla eri versio `latest`-imagen digesteistä. Ratkaisuja:
|
||||
|
||||
### Taso 1: Ei jälkikäsittelyä
|
||||
|
||||
Single repo:
|
||||
```yaml
|
||||
- name: Run tests
|
||||
shell: bash
|
||||
@@ -227,11 +237,27 @@ niillä voi olla eri versio `latest`-imagen digesteistä. Ratkaisuja:
|
||||
|
||||
- name: Report
|
||||
if: always()
|
||||
run: bash .ci/scripts/ci-report.sh "<kuvaus>" <context> <suite> ${{ job.status }}
|
||||
run: |
|
||||
bash .ci/scripts/ci-report.sh "<Test type> test report" <context> <suite> ${{ job.status }}
|
||||
```
|
||||
|
||||
Monorepo:
|
||||
```yaml
|
||||
- name: Run tests
|
||||
shell: bash
|
||||
run: |
|
||||
mkdir -p "reports/<suite>"
|
||||
<testikomento>
|
||||
|
||||
- name: Report
|
||||
if: always()
|
||||
run: |
|
||||
bash .ci/scripts/ci-report.sh "<Komponentti>: <Test type> test report" <komponentti>.<context> <suite> ${{ job.status }}
|
||||
```
|
||||
|
||||
### Taso 2: Jälkikäsittely tarvitaan
|
||||
|
||||
Single repo:
|
||||
```yaml
|
||||
- name: Run tests
|
||||
shell: bash
|
||||
@@ -249,7 +275,30 @@ niillä voi olla eri versio `latest`-imagen digesteistä. Ratkaisuja:
|
||||
|
||||
- name: Report
|
||||
if: always()
|
||||
run: bash .ci/scripts/ci-report.sh "<kuvaus>" <context> <suite> ${{ job.status }}
|
||||
run: |
|
||||
bash .ci/scripts/ci-report.sh "<Test type> test report" <context> <suite> ${{ job.status }}
|
||||
```
|
||||
|
||||
Monorepo:
|
||||
```yaml
|
||||
- name: Run tests
|
||||
shell: bash
|
||||
run: |
|
||||
mkdir -p "reports/<suite>"
|
||||
<testikomento> > "reports/<suite>/results.txt" 2>&1
|
||||
|
||||
- name: Post-process coverage
|
||||
if: always()
|
||||
run: <siirrä coverage-data reports/<suite>/coverage/-hakemistoon>
|
||||
|
||||
- name: Post-process test report
|
||||
if: always()
|
||||
run: <HTML-generointi raa'asta outputista>
|
||||
|
||||
- name: Report
|
||||
if: always()
|
||||
run: |
|
||||
bash .ci/scripts/ci-report.sh "<Komponentti>: <Test type> test report" <komponentti>.<context> <suite> ${{ job.status }}
|
||||
```
|
||||
|
||||
### Väärin vs oikein — yksi asia per step
|
||||
@@ -273,7 +322,16 @@ niillä voi olla eri versio `latest`-imagen digesteistä. Ratkaisuja:
|
||||
|
||||
- name: Report
|
||||
if: always()
|
||||
run: bash .ci/scripts/ci-report.sh "Helm kubeconform" helm-test kubeconform ${{ job.status }}
|
||||
run: |
|
||||
bash .ci/scripts/ci-report.sh "Helm kubeconform" helm-test kubeconform ${{ job.status }}
|
||||
```
|
||||
|
||||
Monorepossa:
|
||||
```yaml
|
||||
- name: Report
|
||||
if: always()
|
||||
run: |
|
||||
bash .ci/scripts/ci-report.sh "<Komponentti>: Helm kubeconform" <komponentti>.helm-test kubeconform ${{ job.status }}
|
||||
```
|
||||
|
||||
### Väärin vs oikein — post-process
|
||||
@@ -509,6 +567,15 @@ jobs:
|
||||
suites: '<suite-1> <suite-2>'
|
||||
```
|
||||
|
||||
**Commit status -kontekstit monorepossa:** Testiraporttien `ci-report.sh`-kutsussa
|
||||
context ja description sisältävät komponentin nimen:
|
||||
```yaml
|
||||
- name: Report
|
||||
if: always()
|
||||
run: |
|
||||
bash .ci/scripts/ci-report.sh "<Komponentti>: Unit test report" <komponentti>.unit-tests bats ${{ job.status }}
|
||||
```
|
||||
|
||||
### Version elinkaari per komponentti
|
||||
|
||||
`GIT_TAG_PREFIX` takaa että eri komponenttien versiohistoria pysyy erillään.
|
||||
|
||||
@@ -158,6 +158,35 @@ Tiedostonimet `.gitea/workflows/`-kansiossa noudattavat yhtenäistä rakennetta:
|
||||
Single repossa `<komponentti>` jätetään pois.
|
||||
Monorepossa prefiksi pitää komponentin tiedostot yhdessä.
|
||||
|
||||
### 6.1 Commit status -nimeäminen
|
||||
|
||||
`ci-report.sh`-kutsun `description` (2. argumentti) ja `context` (3. argumentti)
|
||||
noudattavat seuraavaa kaavaa:
|
||||
|
||||
**Single repo:**
|
||||
```
|
||||
context: <testityyppi> (esim. unit-tests, acc-tests)
|
||||
description: <Test type> test report (esim. Unit test report)
|
||||
```
|
||||
|
||||
**Monorepo:**
|
||||
```
|
||||
context: <komponentti>.<testityyppi> (esim. library.unit-tests)
|
||||
description: <Komponentti>: <Test type> test report (esim. Library: Unit test report)
|
||||
```
|
||||
|
||||
> Gitea YAML: `run:` laita lainausmerkeillä `run: |`-blockiin — Gitea ei tue lainausmerkkejä yhden rivin `run:`-komennoissa.
|
||||
>
|
||||
> ```yaml
|
||||
> - name: Report
|
||||
> if: always()
|
||||
> run: |
|
||||
> bash .ci/scripts/ci-report.sh "<Komponentti>: <Test type> test report" <komponentti>.<context> <suite> ${{ job.status }}
|
||||
> ```
|
||||
|
||||
Build/push-status (Docker, Helm) on providerin hallussa — consumer ei vaikuta
|
||||
niiden nimeämiseen.
|
||||
|
||||
## 7. Artifact-kuri
|
||||
|
||||
Gitea Actionsin `upload-artifact` jättää pysyvän tiedoston. Artifakteja ei käytetä
|
||||
|
||||
Reference in New Issue
Block a user