ci: static-checks: Clean up static-checks job

Now that the static-checks job only takes care of running the
static-checks, let's clean it up, remove all the unneeded steps, make
sure that we're using the actions in their latest version, and have it
running in a cost free runner.

At some point I'd like to see those tests done in parallel, in the same
way that I've organised the build-checks, but that's something for
someone else, at some other time.

Fixes: #7974 -- part 0

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
This commit is contained in:
Fabiano Fidêncio 2023-09-15 18:48:53 +02:00
parent 2c5ca2eaf8
commit 8b1e9b0c75

View File

@ -160,64 +160,35 @@ jobs:
RUST_BACKTRACE: "1" RUST_BACKTRACE: "1"
static-checks: static-checks:
runs-on: garm-ubuntu-2004 runs-on: ubuntu-20.04
strategy: strategy:
# We can set this to true whenever we're 100% sure that
# the all the tests are not flaky, otherwise we'll fail
# all the tests due to a single flaky instance.
fail-fast: false fail-fast: false
matrix: matrix:
cmd: cmd:
- "make static-checks" - "make static-checks"
env: env:
RUST_BACKTRACE: "1"
target_branch: ${{ github.base_ref }}
GOPATH: ${{ github.workspace }} GOPATH: ${{ github.workspace }}
steps: steps:
- name: Free disk space - name: Checkout code
run: | uses: actions/checkout@v4
sudo rm -rf /usr/share/dotnet with:
sudo rm -rf "$AGENT_TOOLSDIRECTORY" fetch-depth: 0
- name: Checkout code path: ./src/github.com/${{ github.repository }}
uses: actions/checkout@v3 - name: Install yq
with: run: |
fetch-depth: 0 cd ${GOPATH}/src/github.com/${{ github.repository }}
path: ./src/github.com/${{ github.repository }} ./ci/install_yq.sh
- name: Install dependencies env:
run: | INSTALL_IN_GOPATH: false
sudo apt-get update - name: Install golang
sudo apt-get install -y --no-install-recommends build-essential haveged run: |
- name: Install Go cd ${GOPATH}/src/github.com/${{ github.repository }}
uses: actions/setup-go@v3 ./tests/install_go.sh -f -p
with: echo "/usr/local/go/bin" >> $GITHUB_PATH
go-version: 1.19.3 - name: Install system dependencies
- name: Set PATH run: |
if: ${{ !contains(github.event.pull_request.labels.*.name, 'force-skip-ci') }} sudo apt-get -y install moreutils
run: | - name: Run check
echo "${{ github.workspace }}/bin" >> $GITHUB_PATH run: |
- name: Setup export PATH=${PATH}:${GOPATH}/bin
if: ${{ !contains(github.event.pull_request.labels.*.name, 'force-skip-ci') }} cd ${GOPATH}/src/github.com/${{ github.repository }} && ${{ matrix.cmd }}
run: |
cd ${GOPATH}/src/github.com/${{ github.repository }} && ./ci/setup.sh
- name: Installing rust
if: ${{ !contains(github.event.pull_request.labels.*.name, 'force-skip-ci') }}
run: |
cd ${GOPATH}/src/github.com/${{ github.repository }} && ./ci/install_rust.sh
PATH=$PATH:"$HOME/.cargo/bin"
rustup target add x86_64-unknown-linux-musl
rustup component add rustfmt clippy
- name: Setup seccomp
if: ${{ !contains(github.event.pull_request.labels.*.name, 'force-skip-ci') }}
run: |
libseccomp_install_dir=$(mktemp -d -t libseccomp.XXXXXXXXXX)
gperf_install_dir=$(mktemp -d -t gperf.XXXXXXXXXX)
cd ${GOPATH}/src/github.com/${{ github.repository }} && ./ci/install_libseccomp.sh "${libseccomp_install_dir}" "${gperf_install_dir}"
echo "Set environment variables for the libseccomp crate to link the libseccomp library statically"
echo "LIBSECCOMP_LINK_TYPE=static" >> $GITHUB_ENV
echo "LIBSECCOMP_LIB_PATH=${libseccomp_install_dir}/lib" >> $GITHUB_ENV
- name: Run check
if: ${{ !contains(github.event.pull_request.labels.*.name, 'force-skip-ci') }}
run: |
export PATH=$PATH:"$HOME/.cargo/bin"
export XDG_RUNTIME_DIR=$(mktemp -d /tmp/kata-tests-$USER.XXX | tee >(xargs chmod 0700))
cd ${GOPATH}/src/github.com/${{ github.repository }} && ${{ matrix.cmd }}