ci: lint scripts directly on runner instead of via docker-in-docker
Some checks failed
cpanel-importer Build and Push / Build-and-Push (push) Failing after 1m17s
Some checks failed
cpanel-importer Build and Push / Build-and-Push (push) Failing after 1m17s
The Gitea runner is itself containerized, so the previous docker run -v "$PWD:/src" --entrypoint php cpanel-importer:smoke -l "/src/$f" shape couldn't bind mount the checkout: the runner's $PWD is not a path the host docker daemon can reach. CI run 3703 surfaced this as "Could not open input file: /src/scripts/scan-dbs.php" — the file existed on the checkout, but the new container saw an empty /src. Running php / bash directly on the runner side-steps the entire DinD issue. ubuntu-latest already ships php-cli and bash, the checkout files live in $PWD where the runner can see them, no docker-socket gymnastics needed. Smoke test (echo ok in the built image) and the build-and-push step keep their docker invocations — those run against the built image artifact, not the source tree, so DinD bind mount isn't involved. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -73,18 +73,25 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
echo "smoke test passed"
|
echo "smoke test passed"
|
||||||
|
|
||||||
|
# Lints run directly on the runner instead of via `docker run -v "$PWD:/src"`
|
||||||
|
# against the built image. Gitea runners are themselves containerized,
|
||||||
|
# so $PWD inside the runner is NOT a path the host docker daemon can bind
|
||||||
|
# mount; the previous approach surfaced as "Could not open input file"
|
||||||
|
# for every script. Running php/bash directly on the runner works because
|
||||||
|
# the runner image (ubuntu-latest) ships php-cli + bash, and the files
|
||||||
|
# exist in $PWD because the checkout step already populated them.
|
||||||
- name: PHP syntax check
|
- name: PHP syntax check
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
for f in scripts/*.php scripts/lib/*.php; do
|
for f in scripts/*.php scripts/lib/*.php; do
|
||||||
docker run --rm -v "$PWD:/src" --entrypoint php cpanel-importer:smoke -l "/src/$f"
|
php -l "$f"
|
||||||
done
|
done
|
||||||
|
|
||||||
- name: Bash syntax check
|
- name: Bash syntax check
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
for f in scripts/*.sh; do
|
for f in scripts/*.sh; do
|
||||||
docker run --rm -v "$PWD:/src" --entrypoint bash cpanel-importer:smoke -n "/src/$f"
|
bash -n "$f"
|
||||||
done
|
done
|
||||||
|
|
||||||
- name: Build and Push Image
|
- name: Build and Push Image
|
||||||
|
|||||||
Reference in New Issue
Block a user