mirror of
https://github.com/anchore/syft
synced 2024-11-10 06:14:16 +00:00
Reduce PR check failures (#858)
This commit is contained in:
parent
1e75cb0418
commit
635904fcb6
3 changed files with 37 additions and 8 deletions
8
.github/workflows/codeql-analysis.yml
vendored
8
.github/workflows/codeql-analysis.yml
vendored
|
@ -7,10 +7,10 @@ name: "CodeQL Security Scan"
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [main]
|
branches:
|
||||||
pull_request:
|
# only run when there are pushes to the main branch (not on PRs)
|
||||||
# The branches below must be a subset of the branches above
|
- main
|
||||||
branches: [main]
|
|
||||||
schedule:
|
schedule:
|
||||||
- cron: '0 0 * * 3'
|
- cron: '0 0 * * 3'
|
||||||
|
|
||||||
|
|
2
.github/workflows/validations.yaml
vendored
2
.github/workflows/validations.yaml
vendored
|
@ -2,6 +2,8 @@ name: "Validations"
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
push:
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
pull_request:
|
pull_request:
|
||||||
|
|
||||||
env:
|
env:
|
||||||
|
|
|
@ -5,6 +5,15 @@ TEST_INSTALL_SH=true
|
||||||
. ../../install.sh
|
. ../../install.sh
|
||||||
set -u
|
set -u
|
||||||
|
|
||||||
|
echoerr() {
|
||||||
|
echo "$@" 1>&2
|
||||||
|
}
|
||||||
|
|
||||||
|
printferr() {
|
||||||
|
printf "%s" "$*" >&2
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
assertTrue() {
|
assertTrue() {
|
||||||
if eval "$1"; then
|
if eval "$1"; then
|
||||||
echo "assertTrue failed: $2"
|
echo "assertTrue failed: $2"
|
||||||
|
@ -93,16 +102,34 @@ setup_snapshot_server() {
|
||||||
python3 -m http.server --directory "$(snapshot_dir)" $serve_port &> /dev/null &
|
python3 -m http.server --directory "$(snapshot_dir)" $serve_port &> /dev/null &
|
||||||
worker_pid=$!
|
worker_pid=$!
|
||||||
|
|
||||||
# it takes some time for the server to be ready...
|
echoerr "serving up $(snapshot_dir) on port $serve_port"
|
||||||
sleep 3
|
|
||||||
|
echoerr "$(ls -1 $(snapshot_dir) | sed 's/^/ ▕―― /')"
|
||||||
|
|
||||||
|
check_snapshots_server_ready
|
||||||
|
|
||||||
|
echoerr "snapshot server ready! (worker=${worker_pid})"
|
||||||
|
|
||||||
echo "$worker_pid"
|
echo "$worker_pid"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
check_snapshots_server_ready() {
|
||||||
|
i=0
|
||||||
|
until $(curl -m 3 --output /dev/null --silent --head --fail localhost:$serve_port/); do
|
||||||
|
sleep 1
|
||||||
|
((i=i+1))
|
||||||
|
if [ "$i" -gt "30" ]; then
|
||||||
|
echoerr "could not connect to local snapshot server! bailing..."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
printferr '.'
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
teardown_snapshot_server() {
|
teardown_snapshot_server() {
|
||||||
worker_pid="$1"
|
worker_pid="$1"
|
||||||
|
echoerr "stopping worker=${worker_pid}"
|
||||||
kill $worker_pid
|
kill "$worker_pid"
|
||||||
}
|
}
|
||||||
|
|
||||||
snapshot_version() {
|
snapshot_version() {
|
||||||
|
|
Loading…
Reference in a new issue