Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 11 additions & 41 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,6 @@ env:
RUSTFLAGS: '-D warnings -C debuginfo=line-tables-only'

jobs:
build-linux-kernel:
name: Build Linux
runs-on: ubuntu-latest
outputs:
kernel-artifact-url: ${{ steps.build.outputs.kernel-artifact-url }}
steps:
- uses: actions/checkout@v6
- uses: d-e-s-o/build-linux@58977e713dea1596c0690ac20e9dcec85fde16b1
id: build
with:
rev: v6.18
config: 'data/config'
vmlinux: 'true'
modules: 'true'
build:
name: Build [${{ matrix.runs-on }}, ${{ matrix.rust }}, ${{ matrix.profile }}, ${{ matrix.args }}]
runs-on: ${{ matrix.runs-on }}
Expand Down Expand Up @@ -191,7 +177,6 @@ jobs:
test-coverage:
name: Test and coverage
runs-on: ubuntu-24.04
needs: [build-linux-kernel]
env:
LLVM_GSYMUTIL: /usr/bin/llvm-gsymutil-18
steps:
Expand All @@ -200,6 +185,13 @@ jobs:
sudo apt-get update
sudo apt-get install --yes --no-install-recommends gcc-multilib libelf-dev zlib1g-dev
- uses: actions/checkout@v6
- uses: d-e-s-o/build-linux@a2c2581c6b44879b6070699618be648480a122c5
id: build
with:
rev: v6.18
config: 'data/config'
vmlinux: 'true'
modules: 'true'
- uses: dtolnay/rust-toolchain@nightly
- uses: Swatinem/rust-cache@v2
with:
Expand All @@ -219,7 +211,6 @@ jobs:
run: rm .cargo/config.toml
- name: Build main.sh
env:
ARTIFACT_URL: ${{ needs.build-linux-kernel.outputs.kernel-artifact-url }}
PYTHON: ${{ steps.py312.outputs.python-path }}
RUSTFLAGS: '--cfg has_large_test_files'
shell: bash
Expand All @@ -233,51 +224,30 @@ jobs:
echo "export PYTHON=${PYTHON}" >> env.sh
source env.sh

# Yes, there appears to be no way to just retrieve the
# uploaded artifact. One can't use actions/download-artifact
# and provide any of the outputs of actions/upload-artifact.
# Neither does it seem possible to just download the thing
# directly, because contents are unconditionally zipped. Good.
# Lord.

# Download artifact in parallel with test compilation. The unzip
# will produce the kernel bzImage, boot/ with vmlinux and aux
# files, and lib/modules/ with modules and aux files.
(curl --location \
--fail-with-body \
--header "Accept: application/vnd.github+json" \
--header "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}"\
--header "X-GitHub-Api-Version: 2022-11-28" \
--output artifact.zip \
"${ARTIFACT_URL}" && unzip artifact.zip) &
artifact_pid=$!

cargo test --no-run --workspace --all-targets --features=zstd,nightly,blazesym-dev/generate-large-test-files 2>&1 | tee /tmp/cargo-build.log
tests=$(IFS='' grep Executable /tmp/cargo-build.log |
awk '{print $NF}' |
sed 's@[()]@@g' |
sed 's@.*@\0 --include-ignored@'
)

wait $artifact_pid

cat <<EOF > main.sh
#!/bin/sh
set -e -u
. ./env.sh
mount -t tmpfs tmpfs /boot
cp -a boot/* /boot/
cp -a ${{ steps.build.outputs.build-dir }}/boot/* /boot/
mount -t tmpfs tmpfs /lib/modules
cp -a lib/modules/* /lib/modules/
insmod lib/modules/6.18.0/kernel/lib/test_hexdump.ko.xz
cp -a ${{ steps.build.outputs.build-dir }}/lib/modules/* /lib/modules/
insmod /lib/modules/6.18.0/kernel/lib/test_hexdump.ko.xz
$tests
cargo llvm-cov report --ignore-filename-regex=cli/src/ --lcov --output-path lcov.info
EOF
chmod a+x main.sh
- name: Test and gather coverage
uses: d-e-s-o/vmsh@3424481c58244ec1410f64dc2d3e52eff3f6e53f
- run: |
vmsh bzImage --env=HOME --env=PATH -- sh -c 'cd ${{ github.workspace }} && ./main.sh'
vmsh ${{ steps.build.outputs.build-dir }}/bzImage --env=HOME --env=PATH -- sh -c 'cd ${{ github.workspace }} && ./main.sh'
- name: Upload code coverage results
uses: codecov/codecov-action@v6
env:
Expand Down
Loading