diff --git a/.github/workflows/build-kernel.yml b/.github/workflows/build-linux.yml similarity index 80% rename from .github/workflows/build-kernel.yml rename to .github/workflows/build-linux.yml index d29eecd22..82941a09b 100644 --- a/.github/workflows/build-kernel.yml +++ b/.github/workflows/build-linux.yml @@ -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: @@ -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 @@ -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 diff --git a/.github/workflows/test-kernel.yml b/.github/workflows/test-kernel.yml new file mode 100644 index 000000000..457f89fd9 --- /dev/null +++ b/.github/workflows/test-kernel.yml @@ -0,0 +1,46 @@ +name: Build Linux + +on: + push: + +jobs: + build-linux-kernel: + runs-on: ubuntu-latest + 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 < 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"