From 9db86d918d48f9b719cf805f41858500e646186e Mon Sep 17 00:00:00 2001 From: moilanik Date: Fri, 12 Jun 2026 17:28:52 +0300 Subject: [PATCH] bats image --- .gitea/workflows/build-feature.yml | 15 ++++++++------- .gitea/workflows/ci.yml | 4 ++++ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/.gitea/workflows/build-feature.yml b/.gitea/workflows/build-feature.yml index fe66cbc..b26aaf1 100644 --- a/.gitea/workflows/build-feature.yml +++ b/.gitea/workflows/build-feature.yml @@ -1,6 +1,10 @@ name: Build Feature on: workflow_call: + inputs: + bats-image: + required: false + type: string jobs: pipeline: @@ -17,17 +21,14 @@ jobs: repository: niko/gitea-ci-library path: .ci - - name: Install bats - run: | - sudo apt-get update - sudo apt-get install -y bats - - name: Bats tests continue-on-error: true run: | mkdir -p "reports/${GITHUB_SHA:0:8}/bats" - bats --formatter junit tests/*.bats > "reports/${GITHUB_SHA:0:8}/bats/junit.xml" 2>&1 || \ - bats tests/*.bats > "reports/${GITHUB_SHA:0:8}/bats/results.txt" 2>&1 + docker run --rm -v "$PWD:/code" ${{ inputs.bats-image }} /code/tests/*.bats > "reports/${GITHUB_SHA:0:8}/bats/results.txt" 2>&1 || true + if [ -f "tests/*.bats" ]; then + docker run --rm -v "$PWD:/code" ${{ inputs.bats-image }} --formatter junit /code/tests/*.bats > "reports/${GITHUB_SHA:0:8}/bats/junit.xml" 2>&1 || true + fi - name: Cucumber tests continue-on-error: true diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 318f665..dddf5ed 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -9,8 +9,12 @@ jobs: if: github.ref != 'refs/heads/main' uses: niko/gitea-ci-library/.gitea/workflows/build-feature.yml@plan/0003-alkaa-käyttämään-itseään-commit-raportti secrets: inherit + with: + bats-image: bats/bats:latest main: if: github.ref == 'refs/heads/main' uses: niko/gitea-ci-library/.gitea/workflows/build-feature.yml@plan/0003-alkaa-käyttämään-itseään-commit-raportti secrets: inherit + with: + bats-image: bats/bats:latest