Skip to content

Test

Test #15

Workflow file for this run

name: Build Linux
on:
push:
jobs:
build-linux-kernel:
uses: ./.github/workflows/build-linux.yml
secrets: inherit
test:
needs: [build-linux-kernel]
name: Test and coverage
runs-on: ubuntu-22.04
env:
LLVM_GSYMUTIL: /usr/bin/llvm-gsymutil-14
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
- uses: Swatinem/rust-cache@v2
- name: Install required tools
run: sudo apt-get install -y llvm-14
- name: Build main.sh
env:
ARTIFACT_URL: ${{ needs.build-linux-kernel.outputs.kernel-artifact-url }}
PYTHON: ${{ steps.py312.outputs.python-path }}
run: |
# Build all tests.
cargo build --tests
# Get a list of tests we just built.
IFS='' tests=$(cargo build -Z unstable-options --tests --build-plan | \
jq -r '
.invocations[] |
select(
.package_name == "blazesym" and
.outputs[0] != null and
(.outputs[0] | endswith(".rlib") | not) and
(.outputs[0] | contains("/build/") | not)
) |
.outputs[0]
')
# 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 is it possible to just download the thing directly,
# because contents are unconditionally zipped. Good. Lord.
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
cat <<EOF > main.sh
set -e -u -o pipefail
export PYTHON=${PYTHON}
${tests}
EOF
chmod a+x main.sh
- name: Test
uses: danobi/vmtest-action@master
with:
kernel: bzImage
command: ${{ github.workspace }}/main.sh