ci: common kernel build and embed ksud (#127)

This commit is contained in:
Ylarod
2023-01-28 12:24:43 +08:00
committed by GitHub
parent 0dae6ebaee
commit 905c041a76
10 changed files with 499 additions and 359 deletions

52
.github/workflows/ksud.yml vendored Normal file
View File

@@ -0,0 +1,52 @@
name: Build ksud
on:
workflow_call:
inputs:
target:
required: true
type: string
use_cache:
required: false
type: boolean
default: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up cargo cache
if: inputs.use_cache == true
uses: actions/cache@v3
continue-on-error: false
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-
- name: Set up ksud build cache
if: inputs.use_cache == true
uses: actions/cache@v3
continue-on-error: false
with:
path: ./userspace/ksud/target/
key: ${{ runner.os }}-ksud-${{ hashFiles('**/Cargo.lock') }}-${{ inputs.target }}
restore-keys: ${{ runner.os }}-ksud-
- name: Build ksud
uses: actions-rs/cargo@v1
with:
use-cross: true
command: build
args: --target ${{ inputs.target }} --release --manifest-path ./userspace/ksud/Cargo.toml
- name: Upload ksud artifact
uses: actions/upload-artifact@v3
with:
name: ksud-${{ inputs.target }}
path: ./userspace/ksud/target/**/release/ksud