mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-06-26 23:38:31 +00:00
Merge pull request #6406 from jepio/jepio/static-checks-workflow-improvements
static checks workflow improvements
This commit is contained in:
commit
adaabd141a
28
.github/workflows/static-checks.yaml
vendored
28
.github/workflows/static-checks.yaml
vendored
@ -19,13 +19,14 @@ jobs:
|
|||||||
- "make test"
|
- "make test"
|
||||||
- "sudo -E PATH=\"$PATH\" make test"
|
- "sudo -E PATH=\"$PATH\" make test"
|
||||||
env:
|
env:
|
||||||
TRAVIS: "true"
|
|
||||||
TRAVIS_BRANCH: ${{ github.base_ref }}
|
|
||||||
TRAVIS_PULL_REQUEST_BRANCH: ${{ github.head_ref }}
|
|
||||||
TRAVIS_PULL_REQUEST_SHA : ${{ github.event.pull_request.head.sha }}
|
|
||||||
RUST_BACKTRACE: "1"
|
RUST_BACKTRACE: "1"
|
||||||
target_branch: ${{ github.base_ref }}
|
target_branch: ${{ github.base_ref }}
|
||||||
|
GOPATH: ${{ github.workspace }}
|
||||||
steps:
|
steps:
|
||||||
|
- name: Free disk space
|
||||||
|
run: |
|
||||||
|
sudo rm -rf /usr/share/dotnet
|
||||||
|
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
@ -35,8 +36,6 @@ jobs:
|
|||||||
uses: actions/setup-go@v3
|
uses: actions/setup-go@v3
|
||||||
with:
|
with:
|
||||||
go-version: 1.19.3
|
go-version: 1.19.3
|
||||||
env:
|
|
||||||
GOPATH: ${{ runner.workspace }}/kata-containers
|
|
||||||
- name: Check kernel config version
|
- name: Check kernel config version
|
||||||
run: |
|
run: |
|
||||||
cd "${{ github.workspace }}/src/github.com/${{ github.repository }}"
|
cd "${{ github.workspace }}/src/github.com/${{ github.repository }}"
|
||||||
@ -52,29 +51,14 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
echo "Check passed"
|
echo "Check passed"
|
||||||
fi
|
fi
|
||||||
- name: Setup GOPATH
|
- name: Set PATH
|
||||||
if: ${{ !contains(github.event.pull_request.labels.*.name, 'force-skip-ci') }}
|
if: ${{ !contains(github.event.pull_request.labels.*.name, 'force-skip-ci') }}
|
||||||
run: |
|
run: |
|
||||||
echo "TRAVIS_BRANCH: ${TRAVIS_BRANCH}"
|
|
||||||
echo "TRAVIS_PULL_REQUEST_BRANCH: ${TRAVIS_PULL_REQUEST_BRANCH}"
|
|
||||||
echo "TRAVIS_PULL_REQUEST_SHA: ${TRAVIS_PULL_REQUEST_SHA}"
|
|
||||||
echo "TRAVIS: ${TRAVIS}"
|
|
||||||
- name: Set env
|
|
||||||
if: ${{ !contains(github.event.pull_request.labels.*.name, 'force-skip-ci') }}
|
|
||||||
run: |
|
|
||||||
echo "GOPATH=${{ github.workspace }}" >> $GITHUB_ENV
|
|
||||||
echo "${{ github.workspace }}/bin" >> $GITHUB_PATH
|
echo "${{ github.workspace }}/bin" >> $GITHUB_PATH
|
||||||
- name: Setup travis references
|
|
||||||
if: ${{ !contains(github.event.pull_request.labels.*.name, 'force-skip-ci') }}
|
|
||||||
run: |
|
|
||||||
echo "TRAVIS_BRANCH=${TRAVIS_BRANCH:-$(echo $GITHUB_REF | awk 'BEGIN { FS = \"/\" } ; { print $3 }')}"
|
|
||||||
target_branch=${TRAVIS_BRANCH}
|
|
||||||
- name: Setup
|
- name: Setup
|
||||||
if: ${{ !contains(github.event.pull_request.labels.*.name, 'force-skip-ci') }}
|
if: ${{ !contains(github.event.pull_request.labels.*.name, 'force-skip-ci') }}
|
||||||
run: |
|
run: |
|
||||||
cd ${GOPATH}/src/github.com/${{ github.repository }} && ./ci/setup.sh
|
cd ${GOPATH}/src/github.com/${{ github.repository }} && ./ci/setup.sh
|
||||||
env:
|
|
||||||
GOPATH: ${{ runner.workspace }}/kata-containers
|
|
||||||
- name: Installing rust
|
- name: Installing rust
|
||||||
if: ${{ !contains(github.event.pull_request.labels.*.name, 'force-skip-ci') }}
|
if: ${{ !contains(github.event.pull_request.labels.*.name, 'force-skip-ci') }}
|
||||||
run: |
|
run: |
|
||||||
|
@ -32,6 +32,7 @@ readonly KATA_HYPERVISOR="${KATA_HYPERVISOR:-}"
|
|||||||
readonly KATA_DEV_MODE="${KATA_DEV_MODE:-}"
|
readonly KATA_DEV_MODE="${KATA_DEV_MODE:-}"
|
||||||
readonly ci_results_dir="/var/osbuilder/tests"
|
readonly ci_results_dir="/var/osbuilder/tests"
|
||||||
readonly dracut_dir=${project_dir}/dracut
|
readonly dracut_dir=${project_dir}/dracut
|
||||||
|
readonly KVM_MISSING="$([ -e /dev/kvm ] || echo true)"
|
||||||
|
|
||||||
build_images=1
|
build_images=1
|
||||||
build_initrds=1
|
build_initrds=1
|
||||||
@ -166,7 +167,7 @@ exit_handler()
|
|||||||
rm -rf "${tmp_dir}"
|
rm -rf "${tmp_dir}"
|
||||||
|
|
||||||
# Restore the default image in config file
|
# Restore the default image in config file
|
||||||
[ -n "${TRAVIS:-}" ] || run_mgr configure-image
|
[ -n "${KVM_MISSING:-}" ] || run_mgr configure-image
|
||||||
|
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
@ -258,8 +259,7 @@ set_runtime()
|
|||||||
|
|
||||||
[ -n "${KATA_DEV_MODE}" ] && return
|
[ -n "${KATA_DEV_MODE}" ] && return
|
||||||
|
|
||||||
# Travis doesn't support VT-x
|
[ -n "${KVM_MISSING:-}" ] && return
|
||||||
[ -n "${TRAVIS:-}" ] && return
|
|
||||||
|
|
||||||
if [ "$KATA_HYPERVISOR" != "firecracker" ]; then
|
if [ "$KATA_HYPERVISOR" != "firecracker" ]; then
|
||||||
if [ -f "$sysconfig_docker_config_file" ]; then
|
if [ -f "$sysconfig_docker_config_file" ]; then
|
||||||
@ -285,8 +285,7 @@ setup()
|
|||||||
sudo -E mkdir -p ${ci_results_dir}
|
sudo -E mkdir -p ${ci_results_dir}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Travis doesn't support VT-x
|
[ -n "${KVM_MISSING:-}" ] && return
|
||||||
[ -n "${TRAVIS:-}" ] && return
|
|
||||||
|
|
||||||
[ ! -d "${tests_repo_dir}" ] && git clone "https://${tests_repo}" "${tests_repo_dir}"
|
[ ! -d "${tests_repo_dir}" ] && git clone "https://${tests_repo}" "${tests_repo_dir}"
|
||||||
|
|
||||||
@ -383,8 +382,7 @@ install_image_create_container()
|
|||||||
[ -z "$file" ] && die "need file"
|
[ -z "$file" ] && die "need file"
|
||||||
[ ! -e "$file" ] && die "file does not exist: $file"
|
[ ! -e "$file" ] && die "file does not exist: $file"
|
||||||
|
|
||||||
# Travis doesn't support VT-x
|
[ -n "${KVM_MISSING:-}" ] && return
|
||||||
[ -n "${TRAVIS:-}" ] && return
|
|
||||||
|
|
||||||
showKataRunFailure=1
|
showKataRunFailure=1
|
||||||
run_mgr reset-config
|
run_mgr reset-config
|
||||||
@ -401,8 +399,7 @@ install_initrd_create_container()
|
|||||||
[ -z "$file" ] && die "need file"
|
[ -z "$file" ] && die "need file"
|
||||||
[ ! -e "$file" ] && die "file does not exist: $file"
|
[ ! -e "$file" ] && die "file does not exist: $file"
|
||||||
|
|
||||||
# Travis doesn't support VT-x
|
[ -n "${KVM_MISSING:-}" ] && return
|
||||||
[ -n "${TRAVIS:-}" ] && return
|
|
||||||
|
|
||||||
showKataRunFailure=1
|
showKataRunFailure=1
|
||||||
run_mgr reset-config
|
run_mgr reset-config
|
||||||
|
Loading…
Reference in New Issue
Block a user