|
6 | 6 | jobs: |
7 | 7 | build: |
8 | 8 | runs-on: ubuntu-latest |
| 9 | + strategy: |
| 10 | + fail-fast: false |
| 11 | + matrix: |
| 12 | + arch: [x86_64, arm64, riscv, loongarch, arm] |
| 13 | + config: [generic.config] |
| 14 | + include: |
| 15 | + - arch: x86_64 |
| 16 | + config: generic.config no-jump-label.config |
9 | 17 |
|
10 | 18 | steps: |
11 | 19 | - uses: actions/checkout@v4 |
12 | | - - name: Run a one-line script |
13 | | - run: echo "Hello, GitHub Actions!" |
| 20 | + with: |
| 21 | + submodules: true |
| 22 | + - name: Install dependencies |
| 23 | + run: | |
| 24 | + sudo apt-get update |
| 25 | + sudo apt-get install -y build-essential libncurses-dev bison flex libssl-dev libelf-dev bc clang lld llvm |
| 26 | + - name: Install Rust |
| 27 | + uses: dtolnay/rust-toolchain@stable |
| 28 | + with: |
| 29 | + components: rust-src |
| 30 | + - name: Install bindgen |
| 31 | + run: cargo install bindgen-cli |
| 32 | + - name: Configure kernel |
| 33 | + run: | |
| 34 | + mkdir -p out |
| 35 | + make -C linux O=../out LLVM=1 ARCH=${{ matrix.arch }} allnoconfig |
| 36 | +
|
| 37 | + MERGE_LIST="configs/${{ matrix.arch }}.config" |
| 38 | + for conf in ${{ matrix.config }}; do |
| 39 | + MERGE_LIST="$MERGE_LIST configs/$conf" |
| 40 | + done |
| 41 | +
|
| 42 | + linux/scripts/kconfig/merge_config.sh -m -O out out/.config $MERGE_LIST |
| 43 | + make -C linux O=../out LLVM=1 ARCH=${{ matrix.arch }} olddefconfig |
| 44 | + cp out/.config config |
| 45 | + - name: Print kernel configuration |
| 46 | + run: cat config |
| 47 | + - name: Load from cache |
| 48 | + uses: actions/cache@v4 |
| 49 | + with: |
| 50 | + path: out |
| 51 | + key: kernel-${{ matrix.arch }}-${{ matrix.config }}-${{ hashFiles('out/.config') }}-${{ github.sha }} |
| 52 | + restore-keys: | |
| 53 | + kernel-${{ matrix.arch }}-${{ matrix.config }}-${{ hashFiles('out/.config') }}- |
| 54 | + - name: Set up incremental compilation |
| 55 | + run: | |
| 56 | + cmp -s config out/.config || cp config out/.config |
| 57 | + cd linux && python3 ../.github/scripts/timestamp.py |
| 58 | + - name: Check Rust availability |
| 59 | + run: make -C linux O=../out LLVM=1 ARCH=${{ matrix.arch }} rustavailable |
| 60 | + - name: Build kernel |
| 61 | + run: | |
| 62 | + make -C linux O=../out LLVM=1 ARCH=${{ matrix.arch }} -j$(nproc) |
| 63 | + - name: Build rustdoc |
| 64 | + run: | |
| 65 | + make -C linux O=../out LLVM=1 ARCH=${{ matrix.arch }} rustdoc |
| 66 | +
|
| 67 | + rustfmt: |
| 68 | + runs-on: ubuntu-latest |
| 69 | + steps: |
| 70 | + - uses: actions/checkout@v4 |
| 71 | + with: |
| 72 | + submodules: true |
| 73 | + - name: Install dependencies |
| 74 | + run: | |
| 75 | + sudo apt-get update |
| 76 | + sudo apt-get install -y build-essential libncurses-dev bison flex libssl-dev libelf-dev bc clang lld llvm |
| 77 | + - uses: dtolnay/rust-toolchain@stable |
| 78 | + with: |
| 79 | + components: rustfmt, rust-src |
| 80 | + - name: Check formatting |
| 81 | + run: make -C linux LLVM=1 rustfmt |
| 82 | + |
| 83 | + checkpatch: |
| 84 | + runs-on: ubuntu-latest |
| 85 | + steps: |
| 86 | + - uses: actions/checkout@v4 |
| 87 | + with: |
| 88 | + submodules: true |
| 89 | + fetch-depth: 2 |
| 90 | + - name: Run checkpatch |
| 91 | + working-directory: linux |
| 92 | + run: ./scripts/checkpatch.pl --git HEAD |
0 commit comments