mirror of
https://github.com/anchore/syft
synced 2024-09-20 06:01:53 +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:
|
||||
push:
|
||||
branches: [main]
|
||||
pull_request:
|
||||
# The branches below must be a subset of the branches above
|
||||
branches: [main]
|
||||
branches:
|
||||
# only run when there are pushes to the main branch (not on PRs)
|
||||
- main
|
||||
|
||||
schedule:
|
||||
- cron: '0 0 * * 3'
|
||||
|
||||
|
|
2
.github/workflows/validations.yaml
vendored
2
.github/workflows/validations.yaml
vendored
|
@ -2,6 +2,8 @@ name: "Validations"
|
|||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
|
||||
env:
|
||||
|
|
|
@ -5,6 +5,15 @@ TEST_INSTALL_SH=true
|
|||
. ../../install.sh
|
||||
set -u
|
||||
|
||||
echoerr() {
|
||||
echo "$@" 1>&2
|
||||
}
|
||||
|
||||
printferr() {
|
||||
printf "%s" "$*" >&2
|
||||
}
|
||||
|
||||
|
||||
assertTrue() {
|
||||
if eval "$1"; then
|
||||
echo "assertTrue failed: $2"
|
||||
|
@ -93,16 +102,34 @@ setup_snapshot_server() {
|
|||
python3 -m http.server --directory "$(snapshot_dir)" $serve_port &> /dev/null &
|
||||
worker_pid=$!
|
||||
|
||||
# it takes some time for the server to be ready...
|
||||
sleep 3
|
||||
echoerr "serving up $(snapshot_dir) on port $serve_port"
|
||||
|
||||
echoerr "$(ls -1 $(snapshot_dir) | sed 's/^/ ▕―― /')"
|
||||
|
||||
check_snapshots_server_ready
|
||||
|
||||
echoerr "snapshot server ready! (worker=${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() {
|
||||
worker_pid="$1"
|
||||
|
||||
kill $worker_pid
|
||||
echoerr "stopping worker=${worker_pid}"
|
||||
kill "$worker_pid"
|
||||
}
|
||||
|
||||
snapshot_version() {
|
||||
|
|
Loading…
Reference in a new issue