ci: static-checks: Move "make test" to the new test matrix

We're moving it out of the previous "static-checks" confusing matrix,
and adding it to the matrix that was currently being used for the `make
vendor` and `make check` checks.

This will allow us to have one job per component, and with that we can
easily run those in parallel and on the zero cost runners.

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 15:51:45 +02:00
parent 08f2e5ae0b
commit 4e963cedf4

View File

@ -52,6 +52,7 @@ jobs:
command: command:
- "make vendor" - "make vendor"
- "make check" - "make check"
- "make test"
include: include:
- component: agent - component: agent
component-path: src/agent component-path: src/agent
@ -71,6 +72,11 @@ jobs:
component-path: src/tools/runk component-path: src/tools/runk
- component: trace-forwarder - component: trace-forwarder
component-path: src/tools/trace-forwarder component-path: src/tools/trace-forwarder
- install-libseccomp: no
- component: agent
install-libseccomp: yes
- component: runk
install-libseccomp: yes
steps: steps:
- name: Checkout the code - name: Checkout the code
uses: actions/checkout@v4 uses: actions/checkout@v4
@ -91,6 +97,23 @@ jobs:
run: | run: |
./tests/install_rust.sh ./tests/install_rust.sh
echo "${HOME}/.cargo/bin" >> $GITHUB_PATH echo "${HOME}/.cargo/bin" >> $GITHUB_PATH
- name: Install musl-tools
if: ${{ matrix.component != 'runtime' }}
run: sudo apt-get -y install musl-tools
- name: Install libseccomp
if: ${{ matrix.command != 'make vendor' && matrix.command != 'make check' && matrix.install-libseccomp == 'yes' }}
run: |
libseccomp_install_dir=$(mktemp -d -t libseccomp.XXXXXXXXXX)
gperf_install_dir=$(mktemp -d -t gperf.XXXXXXXXXX)
./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: Setup XDG_RUNTIME_DIR for the `runtime` tests
if: ${{ matrix.command != 'make vendor' && matrix.command != 'make check' && matrix.component == 'runtime' }}
run: |
XDG_RUNTIME_DIR=$(mktemp -d /tmp/kata-tests-$USER.XXX | tee >(xargs chmod 0700))
echo "XDG_RUNTIME_DIR=${XDG_RUNTIME_DIR}" >> $GITHUB_ENV
- name: Running `${{ matrix.command }}` for ${{ matrix.component }} - name: Running `${{ matrix.command }}` for ${{ matrix.component }}
run: | run: |
cd ${{ matrix.component-path }} cd ${{ matrix.component-path }}
@ -108,7 +131,6 @@ jobs:
matrix: matrix:
cmd: cmd:
- "make static-checks" - "make static-checks"
- "make test"
- "sudo -E PATH=\"$PATH\" make test" - "sudo -E PATH=\"$PATH\" make test"
env: env:
RUST_BACKTRACE: "1" RUST_BACKTRACE: "1"