|
| 1 | +name: RPM Build |
| 2 | +on: |
| 3 | + pull_request: |
| 4 | + branches: |
| 5 | + - '**' |
| 6 | + - '!mainline' |
| 7 | + |
| 8 | +jobs: |
| 9 | + rpm-build-job: |
| 10 | + strategy: |
| 11 | + matrix: |
| 12 | + include: |
| 13 | + - arch: x86_64 |
| 14 | + runner: kernel-build |
| 15 | + mock_config: rocky-9-x86_64 |
| 16 | + - arch: aarch64 |
| 17 | + runner: kernel-build-arm64 |
| 18 | + mock_config: rocky-9-aarch64 |
| 19 | + runs-on: |
| 20 | + labels: ${{ matrix.runner }} |
| 21 | + container: |
| 22 | + image: rockylinux/rockylinux:9 |
| 23 | + options: --privileged --cpus 8 |
| 24 | + steps: |
| 25 | + - name: Install tools and libraries |
| 26 | + run: | |
| 27 | + dnf install -y epel-release |
| 28 | + dnf install -y mock git rust cargo zstd which |
| 29 | + useradd -m -G mock mockbuild |
| 30 | +
|
| 31 | + - name: Checkout code |
| 32 | + uses: actions/checkout@v4 |
| 33 | + with: |
| 34 | + ref: "${{ github.event.pull_request.head.sha }}" |
| 35 | + fetch-depth: 0 |
| 36 | + fetch-tags: true |
| 37 | + |
| 38 | + - name: Generate tarball |
| 39 | + run: | |
| 40 | + git config --global --add safe.directory /__w/kernel-src-tree/kernel-src-tree |
| 41 | + echo "--- git tag count ---" |
| 42 | + git tag | wc -l |
| 43 | + echo "--- git describe ---" |
| 44 | + git describe --tags --abbrev=0 |
| 45 | + ./ciq/SOURCES/generate_tarball.sh |
| 46 | +
|
| 47 | + - name: Bundle bindgen |
| 48 | + run: ./ciq/SOURCES/bundle_bindgen.sh ./ciq/SOURCES |
| 49 | + |
| 50 | + - name: Build SRPM |
| 51 | + run: | |
| 52 | + mkdir -p ../build_files |
| 53 | + chown mockbuild:mock ../build_files |
| 54 | + su mockbuild -c "mock -v -r ${{ matrix.mock_config }} --resultdir=$(pwd)/../build_files \ |
| 55 | + --buildsrpm \ |
| 56 | + --sources=$(pwd)/ciq/SOURCES \ |
| 57 | + --spec=$(pwd)/ciq/SPECS/kernel-clk6.18.spec" |
| 58 | +
|
| 59 | + - name: Build RPM |
| 60 | + run: | |
| 61 | + SRPM=$(ls ../build_files/*.src.rpm | head -1) |
| 62 | + su mockbuild -c "mock -v -r ${{ matrix.mock_config }} --resultdir=$(pwd)/../build_files $SRPM" |
0 commit comments