katetaan puuttuva testit
This commit is contained in:
@@ -8,9 +8,17 @@ REPORT_DIR="${2:-}"
|
||||
[ -n "$REPORT_DIR" ] || { echo "ERROR: report directory required" >&2; exit 1; }
|
||||
|
||||
HAS_COVERAGE=false
|
||||
if docker run --rm -v "$WORKSPACE_VOLUME":/data alpine sh -c '[ -d /data/coverage ] && ls -A /data/coverage | grep -q .' 2>/dev/null; then
|
||||
COVERAGE_SRC=""
|
||||
for candidate in /data/scripts/coverage /data/coverage; do
|
||||
if docker run --rm -v "$WORKSPACE_VOLUME":/data alpine sh -c "[ -d \"$candidate\" ] && ls -A \"$candidate\" | grep -q ." 2>/dev/null; then
|
||||
COVERAGE_SRC="$candidate"
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
if [ -n "$COVERAGE_SRC" ]; then
|
||||
mkdir -p "$REPORT_DIR/coverage"
|
||||
docker run --rm -v "$WORKSPACE_VOLUME":/data alpine tar c -C /data/coverage . | tar x -C "$REPORT_DIR/coverage"
|
||||
docker run --rm -v "$WORKSPACE_VOLUME":/data alpine tar c -C "$COVERAGE_SRC" . | tar x -C "$REPORT_DIR/coverage"
|
||||
HAS_COVERAGE=true
|
||||
fi
|
||||
|
||||
|
||||
@@ -58,8 +58,8 @@ jobs:
|
||||
-v bats-workspace:/data \
|
||||
--entrypoint bash ${{ inputs.bats-image }} \
|
||||
-c 'apk add -q lsof python3 jq curl ruby && cd /data && \
|
||||
gem install bashcov 2>&1 | tail -1 && \
|
||||
bashcov --include scripts/ -- bats tests/' \
|
||||
gem install bashcov -v 3.3.0 2>&1 | tail -1 && \
|
||||
bashcov --root /data/scripts/ -- bats tests/' \
|
||||
> "reports/${GITHUB_SHA:0:8}/bats/results.txt" 2>&1
|
||||
BATS_EXIT=$?
|
||||
bash .ci/.gitea/scripts/bats-coverage.sh bats-workspace "reports/${GITHUB_SHA:0:8}/bats"
|
||||
|
||||
@@ -8,7 +8,7 @@ jobs:
|
||||
load-config:
|
||||
uses: niko/gitea-ci-library/.gitea/workflows/config-provider.yml@feature/pipeline-cleanup
|
||||
with:
|
||||
config_path: .gitea/workflows/feature-env.conf
|
||||
config_path: .gitea/workflows/gitea-env.conf
|
||||
|
||||
feature:
|
||||
if: github.ref != 'refs/heads/main'
|
||||
|
||||
Reference in New Issue
Block a user