Files
gitea-ci-library/.gitea/workflows/example-bats-tests.yml
T
niko 737b2fc3f2
unit-tests Bats test report
CI Main / Bats tests (push) Successful in 1m21s
ci-docker-build-push Docker build & push 0.2.9 OK
CI Main / Build & Push Docker (push) Successful in 40s
CI Main / Report Summary (push) Successful in 5s
CI Main / Move provider version tag (push) Successful in 12s
CI Main / Load example-gitea-env.conf to pipeline env (push) Successful in 18s
CI Main / Check existing artifact (push) Successful in 12s
acc-tests Cucumber test report
CI Main / Cucumber tests (push) Successful in 2m3s
Feature/yksinkertaistetaan raportointi logiikkaa (#22)
Co-authored-by: moilanik <niko.moilanen@tietoevry.com>
Reviewed-on: #22
2026-06-18 12:55:02 +03:00

52 lines
1.3 KiB
YAML

name: Bats Tests
on:
workflow_call:
inputs:
env_json:
required: true
type: string
bats-image:
required: false
type: string
default: gitea.app.keskikuja.site/niko/ci-bats:latest
secrets:
GITEA_TOKEN:
required: true
GIT_PAGES_PUBLISH_TOKEN:
required: true
env:
GITEA_API_URL: ${{ fromJson(inputs.env_json).GITEA_API_URL }}
GIT_PAGES_URL: ${{ fromJson(inputs.env_json).GIT_PAGES_URL }}
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
GIT_PAGES_PUBLISH_TOKEN: ${{ secrets.GIT_PAGES_PUBLISH_TOKEN }}
jobs:
bats:
runs-on: ubuntu-latest
container:
image: ${{ inputs.bats-image }}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v4
with:
repository: niko/gitea-ci-library
path: .ci
- name: Run bats tests
run: |
mkdir -p reports/bats
bashcov -- bats tests/ > reports/bats/results.txt 2>&1
- name: Post-process coverage
if: always()
run: bash .ci/.gitea/scripts/bats-coverage.sh reports/bats
- name: Post-process test report
if: always()
run: bash .ci/.gitea/scripts/bats-report.sh reports/bats
- name: Report
if: always()
run: bash .ci/scripts/ci-report.sh "Bats test report" unit-tests bats