bats image
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user