Skip to content

Commit

Permalink
Next
Browse files Browse the repository at this point in the history
  • Loading branch information
d-e-s-o committed Jul 31, 2024
1 parent 68c78a2 commit 120d360
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
name: Build Linux

on:
push:
workflow_call:
outputs:
linux-kernel-url:
description: "URL of the built (and uploaded) Linux kernel"
value: ${{ jobs.build.upload-kernel-image.outputs.artifact-url }}

jobs:
build:
Expand All @@ -11,7 +15,7 @@ jobs:
- uses: actions/cache/restore@v4
id: restore-cached-kernel
with:
path: data/build/arch/x86/boot/bzImage
path: build/arch/x86/boot/bzImage
key: linux-kernel
- if: steps.restore-cached-kernel.outputs.cache-hit != 'true'
uses: actions/checkout@v4
Expand Down Expand Up @@ -45,10 +49,11 @@ jobs:
- if: steps.restore-cached-kernel.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
path: data/build/arch/x86/boot/bzImage
path: build/arch/x86/boot/bzImage
key: linux-kernel
- uses: actions/upload-artifact@v4
id: upload-linux-kernel
with:
name: linux-kernel-image
if-no-files-found: error
path: data/build/arch/x86/boot/bzImage
path: build/arch/x86/boot/bzImage
45 changes: 45 additions & 0 deletions .github/workflows/test-kernel.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Build Linux

on:
push:

jobs:
build-linux-kernel:
outputs:
linux-kernel-url: ${{ steps.build.outputs.linux-kernel-url }}
steps:
- id: build
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
- uses: actions/setup-python@v5
id: py312
with:
python-version: '3.12'
- name: Install required tools
run: sudo apt-get install -y llvm-14
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Build main.sh
env:
PYTHON: ${{ steps.py312.outputs.python-path }}
run: |
cat <<EOF > main.sh
export PYTHON=${PYTHON}
exec cargo test --workspace --all-targets --features=nightly,generate-large-test-files -- --include-ignored
EOF
chmod a+x main.sh
- name: Test
uses: danobi/vmtest-action@v0.6
with:
kernel_url: ${{ jobs.build-linux-kernel.outputs.linux-kernel-url }}
command: "/bin/bash -c ${{ github.workspace }}/main.sh"

0 comments on commit 120d360

Please sign in to comment.