From cd8157ba96e7a22152d7edafbad576258819d130 Mon Sep 17 00:00:00 2001 From: Michael Ellerman Date: Wed, 20 Nov 2024 12:21:13 +1100 Subject: [PATCH] CI: Add CI configuration to linux-next 20241220 --- .../problem-matchers/compiler-non-source.json | 17 ++ .github/problem-matchers/compiler-source.json | 17 ++ .github/problem-matchers/sparse.json | 17 ++ .github/workflows/powerpc-allconfig.yml | 74 +++++++ .github/workflows/powerpc-clang.yml | 73 +++++++ .github/workflows/powerpc-extrawarn.yml | 72 +++++++ .github/workflows/powerpc-kernel+qemu.yml | 204 ++++++++++++++++++ .github/workflows/powerpc-perf.yml | 59 +++++ .github/workflows/powerpc-ppctests.yml | 61 ++++++ .github/workflows/powerpc-selftests.yml | 61 ++++++ .github/workflows/powerpc-sparse.yml | 93 ++++++++ .github/workflows/powerpc-update.yml | 38 ++++ README.md | 5 + arch/powerpc/configs/g5-qemu.config | 2 + arch/powerpc/configs/pmac32-qemu.config | 5 + arch/powerpc/configs/ppc44x-qemu.config | 2 + arch/powerpc/tools/ci-build.sh | 85 ++++++++ 17 files changed, 885 insertions(+) create mode 100644 .github/problem-matchers/compiler-non-source.json create mode 100644 .github/problem-matchers/compiler-source.json create mode 100644 .github/problem-matchers/sparse.json create mode 100644 .github/workflows/powerpc-allconfig.yml create mode 100644 .github/workflows/powerpc-clang.yml create mode 100644 .github/workflows/powerpc-extrawarn.yml create mode 100644 .github/workflows/powerpc-kernel+qemu.yml create mode 100644 .github/workflows/powerpc-perf.yml create mode 100644 .github/workflows/powerpc-ppctests.yml create mode 100644 .github/workflows/powerpc-selftests.yml create mode 100644 .github/workflows/powerpc-sparse.yml create mode 100644 .github/workflows/powerpc-update.yml create mode 100644 README.md create mode 100644 arch/powerpc/configs/g5-qemu.config create mode 100644 arch/powerpc/configs/pmac32-qemu.config create mode 100644 arch/powerpc/configs/ppc44x-qemu.config create mode 100755 arch/powerpc/tools/ci-build.sh diff --git a/.github/problem-matchers/compiler-non-source.json b/.github/problem-matchers/compiler-non-source.json new file mode 100644 index 0000000000000..5a21a7dcbb594 --- /dev/null +++ b/.github/problem-matchers/compiler-non-source.json @@ -0,0 +1,17 @@ +{ + "problemMatcher": [ + { + "__comment_owner": "match compiler warning/error lines not from source", + "owner": "compiler-non-source", + "pattern": [ + { + "__comment_regexp1": "clang: warning: argument unused during compilation: '-march=armv7-a' [-Wunused-command-line-argument]", + "__comment_regexp2": "ld.lld: warning: lld uses blx instruction, no object with architecture supporting feature detected", + "regexp": "^(?:[^:]+): (?:fatal\\s+)?(warning|error):\\s+(.*)$", + "severity": 1, + "message": 2 + } + ] + } + ] +} diff --git a/.github/problem-matchers/compiler-source.json b/.github/problem-matchers/compiler-source.json new file mode 100644 index 0000000000000..e719f671e8dc7 --- /dev/null +++ b/.github/problem-matchers/compiler-source.json @@ -0,0 +1,17 @@ +{ + "problemMatcher": [ + { + "owner": "gcc-problem-matcher", + "pattern": [ + { + "regexp": "^(?:/linux/)?(.*):(\\d+):(\\d+):\\s+(?:fatal\\s+)?(warning|error):\\s+(.*)$", + "file": 1, + "line": 2, + "column": 3, + "severity": 4, + "message": 5 + } + ] + } + ] +} diff --git a/.github/problem-matchers/sparse.json b/.github/problem-matchers/sparse.json new file mode 100644 index 0000000000000..83c626e5448e4 --- /dev/null +++ b/.github/problem-matchers/sparse.json @@ -0,0 +1,17 @@ +{ + "problemMatcher": [ + { + "owner": "powerpc-sparse", + "pattern": [ + { + "regexp": "^\\+(?:/linux/)?(.*):(\\d+|XX):(\\d+|XX):\\s+(error|warning):\\s+(.*)$", + "file": 1, + "line": 2, + "column": 3, + "severity": 4, + "message": 5 + } + ] + } + ] +} diff --git a/.github/workflows/powerpc-allconfig.yml b/.github/workflows/powerpc-allconfig.yml new file mode 100644 index 0000000000000..007eabed44a33 --- /dev/null +++ b/.github/workflows/powerpc-allconfig.yml @@ -0,0 +1,74 @@ +name: powerpc/allconfig + +# Controls when the action will run. +on: + # This allows the build to be triggered manually via the github UI. + workflow_dispatch: + +jobs: + kernel: + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + include: + # ppc64le allmod and allyes + - subarch: ppc64le + defconfig: ppc64le_allmodconfig + image: fedora-40 + - subarch: ppc64le + defconfig: allyesconfig + image: fedora-40 + merge_config: /linux/arch/powerpc/configs/le.config + # ppc64 allmod and allyes + - subarch: ppc64 + defconfig: allmodconfig + image: fedora-40 + - subarch: ppc64 + defconfig: allyesconfig + image: fedora-40 + # ppc32 allmod + - subarch: ppc + defconfig: ppc32_allmodconfig + image: fedora-40 + # ppc64 book3e allmod + # Broken due to head_check.sh + #- subarch: ppc64 + # defconfig: ppc64_book3e_allmodconfig + # image: fedora-40 + + env: + ARCH: powerpc + TARGET: kernel + CCACHE: 1 + SUBARCH: ${{ matrix.subarch }} + IMAGE: ${{ matrix.image }} + DEFCONFIG: ${{ matrix.defconfig }} + MERGE_CONFIG: /linux/arch/powerpc/configs/disable-werror.config,${{ matrix.merge_config }} + + steps: + - uses: actions/checkout@v4 + + - name: Register problem matchers + run: | + echo "::add-matcher::.github/problem-matchers/compiler-source.json" + echo "::add-matcher::.github/problem-matchers/compiler-non-source.json" + + - name: Load ccache + uses: actions/cache@v4 + with: + path: ~/.ccache + key: ${{ matrix.image }}-${{ matrix.subarch }}-${{ matrix.defconfig }} + + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build + run: | + mkdir -p ~/.ccache + ./arch/powerpc/tools/ci-build.sh diff --git a/.github/workflows/powerpc-clang.yml b/.github/workflows/powerpc-clang.yml new file mode 100644 index 0000000000000..39c7f3c6deaba --- /dev/null +++ b/.github/workflows/powerpc-clang.yml @@ -0,0 +1,73 @@ +name: powerpc/clang + +# Controls when the action will run. +on: + # run at 2:30am AEST == 4:30pm UTC + schedule: + - cron: '30 16 * * *' + # This allows the build to be triggered manually via the github UI. + workflow_dispatch: + +jobs: + kernel: + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + defconfig: [ppc64, corenet64_smp, pmac32, mpc885_ads] + image: [fedora-40] + subarch: [ppc64] + include: + - subarch: ppc64le + defconfig: ppc64le + image: fedora-40 + + env: + CLANG: 1 + LLVM_IAS: 0 + ARCH: powerpc + TARGET: kernel + CCACHE: 1 + SUBARCH: ${{ matrix.subarch }} + IMAGE: ${{ matrix.image }} + DEFCONFIG: ${{ matrix.defconfig }} + MERGE_CONFIG: /linux/arch/powerpc/configs/disable-werror.config + + steps: + - uses: actions/checkout@v4 + + - name: Register problem matchers + run: | + echo "::add-matcher::.github/problem-matchers/compiler-source.json" + echo "::add-matcher::.github/problem-matchers/compiler-non-source.json" + + - name: Load ccache + uses: actions/cache@v4 + with: + path: ~/.ccache + key: ${{ matrix.image }}-${{ matrix.subarch }}-${{ matrix.defconfig }} + + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build + run: | + mkdir -p ~/.ccache + ./arch/powerpc/tools/ci-build.sh + + - name: Archive artifacts + uses: actions/upload-artifact@v4 + with: + name: ${{ matrix.defconfig }}-${{ matrix.image }} + path: | + ~/output/vmlinux + ~/output/.config + ~/output/System.map + ~/output/modules.tar.bz2 + ~/output/arch/powerpc/boot/zImage + ~/output/arch/powerpc/boot/uImage diff --git a/.github/workflows/powerpc-extrawarn.yml b/.github/workflows/powerpc-extrawarn.yml new file mode 100644 index 0000000000000..85ba1e39a736c --- /dev/null +++ b/.github/workflows/powerpc-extrawarn.yml @@ -0,0 +1,72 @@ +name: powerpc/extrawarn + +# Controls when the action will run. +on: + # Only when triggered manually via the github UI. + workflow_dispatch: + +jobs: + kernel: + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + defconfig: [ppc64, corenet64_smp, pmac32, ppc44x, mpc885_ads, corenet32_smp] + image: [fedora-40, korg-5.5.0] + subarch: [ppc64] + include: + - subarch: ppc64le + defconfig: ppc64le + image: korg-5.5.0 + - subarch: ppc64le + defconfig: ppc64le + image: fedora-40 + + env: + ARCH: powerpc + TARGET: kernel + CCACHE: 1 + SUBARCH: ${{ matrix.subarch }} + IMAGE: ${{ matrix.image }} + DEFCONFIG: ${{ matrix.defconfig }} + MERGE_CONFIG: /linux/arch/powerpc/configs/disable-werror.config + KBUILD_EXTRA_WARN: 1 + + steps: + - uses: actions/checkout@v4 + + - name: Register problem matchers + run: | + echo "::add-matcher::.github/problem-matchers/compiler-source.json" + echo "::add-matcher::.github/problem-matchers/compiler-non-source.json" + + - name: Load ccache + uses: actions/cache@v4 + with: + path: ~/.ccache + key: ${{ matrix.image }}-${{ matrix.subarch }}-${{ matrix.defconfig }} + + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build + run: | + mkdir -p ~/.ccache + ./arch/powerpc/tools/ci-build.sh + + - name: Archive artifacts + uses: actions/upload-artifact@v4 + with: + name: ${{ matrix.defconfig }}-${{ matrix.image }} + path: | + ~/output/vmlinux + ~/output/.config + ~/output/System.map + ~/output/modules.tar.bz2 + ~/output/arch/powerpc/boot/zImage + ~/output/arch/powerpc/boot/uImage diff --git a/.github/workflows/powerpc-kernel+qemu.yml b/.github/workflows/powerpc-kernel+qemu.yml new file mode 100644 index 0000000000000..20e5a6a4cf926 --- /dev/null +++ b/.github/workflows/powerpc-kernel+qemu.yml @@ -0,0 +1,204 @@ +name: powerpc/kernel+qemu + +# Controls when the action will run. +on: + # run at 2:30am AEST == 4:30pm UTC + schedule: + - cron: '30 16 * * *' + # This allows the build to be triggered manually via the github UI. + workflow_dispatch: + +jobs: + kernel: + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + defconfig: [ppc64_defconfig, mpc885_ads_defconfig] + image: [fedora-40, korg-5.5.0] + include: + # ppc64le_guest_defconfig + - subarch: ppc64le + defconfig: ppc64le_guest_defconfig + image: fedora-40 + - subarch: ppc64le + defconfig: ppc64le_guest_defconfig + image: korg-5.5.0 + + # ppc44x + - defconfig: ppc44x_defconfig + merge_config: /linux/arch/powerpc/configs/ppc44x-qemu.config + image: fedora-40 + - defconfig: ppc44x_defconfig + merge_config: /linux/arch/powerpc/configs/ppc44x-qemu.config + image: korg-5.5.0 + + # corenet64_smp + - defconfig: corenet64_smp_defconfig + image: fedora-40 + - defconfig: corenet64_smp_defconfig + image: korg-5.5.0 + + # g5 + - defconfig: g5_defconfig + merge_config: /linux/arch/powerpc/configs/g5-qemu.config + image: fedora-40 + - defconfig: g5_defconfig + merge_config: /linux/arch/powerpc/configs/g5-qemu.config + image: korg-5.5.0 + + # pmac32 + - defconfig: pmac32_defconfig + merge_config: /linux/arch/powerpc/configs/pmac32-qemu.config + image: fedora-40 + - defconfig: pmac32_defconfig + merge_config: /linux/arch/powerpc/configs/pmac32-qemu.config + image: korg-5.5.0 + + - defconfig: corenet32_smp_defconfig + image: fedora-40 + + env: + ARCH: powerpc + TARGET: kernel + CCACHE: 1 + SUBARCH: ${{ matrix.subarch }} + IMAGE: ${{ matrix.image }} + DEFCONFIG: ${{ matrix.defconfig }} + MERGE_CONFIG: ${{ matrix.merge_config }} + + steps: + - uses: actions/checkout@v4 + + - name: Register problem matchers + run: | + echo "::add-matcher::.github/problem-matchers/compiler-source.json" + echo "::add-matcher::.github/problem-matchers/compiler-non-source.json" + + - name: Load ccache + uses: actions/cache@v4 + with: + path: ~/.ccache + key: ${{ matrix.image }}-${{ matrix.subarch }}-${{ matrix.defconfig }} + + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build + run: | + mkdir -p ~/.ccache + ./arch/powerpc/tools/ci-build.sh + + - name: Archive artifacts + uses: actions/upload-artifact@v4 + with: + name: ${{ matrix.defconfig }}-${{ matrix.image }} + path: | + ~/output/vmlinux + ~/output/.config + ~/output/System.map + ~/output/modules.tar.bz2 + ~/output/arch/powerpc/boot/zImage + ~/output/arch/powerpc/boot/uImage + ~/output/include/config/kernel.release + + boot: + runs-on: ubuntu-latest + needs: kernel + + strategy: + fail-fast: false + matrix: + include: + - defconfig: ppc64le_guest_defconfig + machine: pseries+p8+tcg + machine_2: pseries+p9+tcg + packages: qemu-system-ppc64 + rootfs: ppc64le-rootfs.cpio.gz + old-image: korg-5.5.0 + new-image: fedora-40 + + - defconfig: ppc64le_guest_defconfig + machine: powernv+p8+tcg + machine_2: powernv+p9+tcg + packages: qemu-system-ppc64 + rootfs: ppc64le-rootfs.cpio.gz + old-image: korg-5.5.0 + new-image: fedora-40 + + - defconfig: ppc44x_defconfig + machine: 44x + packages: qemu-system-ppc + rootfs: ppc-rootfs.cpio.gz + old-image: korg-5.5.0 + new-image: fedora-40 + + - defconfig: corenet64_smp_defconfig + machine: ppc64e + machine_2: ppc64e+compat + packages: qemu-system-ppc64 + rootfs: ppc64-novsx-rootfs.cpio.gz ppc-rootfs.cpio.gz + old-image: korg-5.5.0 + new-image: fedora-40 + + - defconfig: g5_defconfig + machine: g5 + packages: qemu-system-ppc64 openbios-ppc + rootfs: ppc64-rootfs.cpio.gz + old-image: korg-5.5.0 + new-image: fedora-40 + + - defconfig: pmac32_defconfig + machine: mac99 + packages: qemu-system-ppc openbios-ppc + rootfs: ppc-rootfs.cpio.gz + old-image: korg-5.5.0 + new-image: fedora-40 + + steps: + - uses: actions/checkout@v4 + with: + repository: linuxppc/ci-scripts + + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Download root disk + run: make -C root-disks ${{ matrix.rootfs }} + + - name: APT update + run: sudo apt update + + - name: Install dependencies + run: sudo apt install -y ${{ matrix.packages }} python3-pexpect python3-termcolor python3-yaml + + - uses: actions/download-artifact@v4 + with: + name: ${{ matrix.defconfig }}-${{ matrix.new-image }} + + - name: Run qemu-${{ matrix.machine }} with ${{ matrix.new-image }} build kernel + run: ./scripts/boot/qemu-${{ matrix.machine }} + + - name: Run qemu-${{ matrix.machine_2 }} with ${{ matrix.new-image }} build kernel + run: ./scripts/boot/qemu-${{ matrix.machine_2 }} + if: matrix.machine_2 != '' + + - uses: actions/download-artifact@v4 + with: + name: ${{ matrix.defconfig }}-${{ matrix.old-image }} + + - name: Run qemu-${{ matrix.machine }} with ${{ matrix.old-image }} build kernel + run: ./scripts/boot/qemu-${{ matrix.machine }} + + - name: Run qemu-${{ matrix.machine_2 }} with ${{ matrix.old-image }} build kernel + run: ./scripts/boot/qemu-${{ matrix.machine_2 }} + if: matrix.machine_2 != '' diff --git a/.github/workflows/powerpc-perf.yml b/.github/workflows/powerpc-perf.yml new file mode 100644 index 0000000000000..6c0fd268d44ac --- /dev/null +++ b/.github/workflows/powerpc-perf.yml @@ -0,0 +1,59 @@ +name: powerpc/perf + +# Controls when the action will run. +on: + # run at 2:30am AEST == 4:30pm UTC + schedule: + - cron: '30 16 * * *' + # This allows the build to be triggered manually via the github UI. + workflow_dispatch: + +jobs: + perf: + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + image: [ubuntu-22.04, ubuntu-20.04, ubuntu-18.04] + subarch: [ppc64, ppc64le] + + env: + ARCH: powerpc + TARGET: perf + CCACHE: 1 + SUBARCH: ${{ matrix.subarch }} + IMAGE: ${{ matrix.image }} + + steps: + - uses: actions/checkout@v4 + + - name: Register problem matchers + run: | + echo "::add-matcher::.github/problem-matchers/compiler-source.json" + echo "::add-matcher::.github/problem-matchers/compiler-non-source.json" + + - name: Load ccache + uses: actions/cache@v4 + with: + path: ~/.ccache + key: ${{ matrix.image }}-${{ matrix.subarch }}-${{ matrix.defconfig }} + + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build + run: | + mkdir -p ~/.ccache + ./arch/powerpc/tools/ci-build.sh + + - name: Archive artifacts + uses: actions/upload-artifact@v4 + with: + name: ${{ matrix.subarch }}-${{ matrix.image }} + path: | + ~/output diff --git a/.github/workflows/powerpc-ppctests.yml b/.github/workflows/powerpc-ppctests.yml new file mode 100644 index 0000000000000..356c3ba0fa57a --- /dev/null +++ b/.github/workflows/powerpc-ppctests.yml @@ -0,0 +1,61 @@ +name: powerpc/ppctests + +# Controls when the action will run. +on: + # run at 2:30am AEST == 4:30pm UTC + schedule: + - cron: '30 16 * * *' + # This allows the build to be triggered manually via the github UI. + workflow_dispatch: + +jobs: + ppctests: + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + image: [ubuntu-22.04, ubuntu-20.04, ubuntu-18.04, ubuntu-16.04] + subarch: [ppc64, ppc64le] + + env: + ARCH: powerpc + TARGET: ppctests + CCACHE: 1 + INSTALL: 1 + VERBOSE: 1 + SUBARCH: ${{ matrix.subarch }} + IMAGE: ${{ matrix.image }} + + steps: + - uses: actions/checkout@v4 + + - name: Register problem matchers + run: | + echo "::add-matcher::.github/problem-matchers/compiler-source.json" + echo "::add-matcher::.github/problem-matchers/compiler-non-source.json" + + - name: Load ccache + uses: actions/cache@v4 + with: + path: ~/.ccache + key: ${{ matrix.image }}-${{ matrix.subarch }}-${{ matrix.defconfig }} + + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build + run: | + mkdir -p ~/.ccache + ./arch/powerpc/tools/ci-build.sh + + - name: Archive artifacts + uses: actions/upload-artifact@v4 + with: + name: ${{ matrix.subarch }}-${{ matrix.image }} + path: | + ~/output/install diff --git a/.github/workflows/powerpc-selftests.yml b/.github/workflows/powerpc-selftests.yml new file mode 100644 index 0000000000000..6a02a402f4fd5 --- /dev/null +++ b/.github/workflows/powerpc-selftests.yml @@ -0,0 +1,61 @@ +name: powerpc/selftests + +# Controls when the action will run. +on: + # run at 2:30am AEST == 4:30pm UTC + schedule: + - cron: '30 16 * * *' + # This allows the build to be triggered manually via the github UI. + workflow_dispatch: + +jobs: + selftests: + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + image: [ubuntu-22.04, ubuntu-20.04, ubuntu-18.04, ubuntu-16.04] + subarch: [ppc64, ppc64le] + + env: + ARCH: powerpc + TARGET: selftests + CCACHE: 1 + INSTALL: 1 + VERBOSE: 1 + SUBARCH: ${{ matrix.subarch }} + IMAGE: ${{ matrix.image }} + + steps: + - uses: actions/checkout@v4 + + - name: Register problem matchers + run: | + echo "::add-matcher::.github/problem-matchers/compiler-source.json" + echo "::add-matcher::.github/problem-matchers/compiler-non-source.json" + + - name: Load ccache + uses: actions/cache@v4 + with: + path: ~/.ccache + key: ${{ matrix.image }}-${{ matrix.subarch }}-${{ matrix.defconfig }} + + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build + run: | + mkdir -p ~/.ccache + ./arch/powerpc/tools/ci-build.sh + + - name: Archive artifacts + uses: actions/upload-artifact@v4 + with: + name: ${{ matrix.subarch }}-${{ matrix.image }} + path: | + ~/output/install diff --git a/.github/workflows/powerpc-sparse.yml b/.github/workflows/powerpc-sparse.yml new file mode 100644 index 0000000000000..da78ef9f2b760 --- /dev/null +++ b/.github/workflows/powerpc-sparse.yml @@ -0,0 +1,93 @@ +name: powerpc/sparse + +# Controls when the action will run. +on: + # run at 2:30am AEST == 4:30pm UTC + schedule: + - cron: '30 16 * * *' + # This allows the build to be triggered manually via the github UI. + workflow_dispatch: + +jobs: + sparse: + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + defconfig: [ppc64, pmac32, mpc885_ads_defconfig] + image: [fedora-40] + subarch: [ppc64] + include: + - subarch: ppc64le + defconfig: ppc64le + image: fedora-40 + + env: + ARCH: powerpc + TARGET: kernel + CCACHE: 1 + SPARSE: 2 + SUBARCH: ${{ matrix.subarch }} + IMAGE: ${{ matrix.image }} + DEFCONFIG: ${{ matrix.defconfig }} + + steps: + - name: Checkout + uses: actions/checkout@v4 + + # NB this is before the build on merge, so all errors are detected + # On other branches we ignore these and only report sparse diff results below + - name: Register problem matchers + if: github.ref_name == 'merge' + run: | + echo "::add-matcher::.github/problem-matchers/compiler-source.json" + echo "::add-matcher::.github/problem-matchers/compiler-non-source.json" + + - name: Load ccache + uses: actions/cache@v4 + with: + path: ~/.ccache + key: ${{ matrix.image }}-${{ matrix.subarch }}-${{ matrix.defconfig }} + + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build + run: | + mkdir -p ~/.ccache + ./arch/powerpc/tools/ci-build.sh + + - name: Get sparse results from base tree + if: github.ref_name != 'merge' + continue-on-error: true + uses: dawidd6/action-download-artifact@v2 + with: + workflow: powerpc-sparse.yml + workflow_conclusion: success + branch: merge # Requires the merge branch to be built once before this will work + name: sparse-${{ matrix.defconfig }}-${{ matrix.image }}.log + + # NB this is after the build on non-merge, so only errors from the sparse diff are detected + - name: Register problem matcher + if: github.ref_name != 'merge' + run: | + echo "::add-matcher::.github/problem-matchers/sparse.json" + + - name: Compare sparse results with base + if: github.ref_name != 'merge' + run: | + bash -c 'if [ ! -f sparse.log ]; then cp ~/output/sparse.log .; fi' + ./arch/powerpc/tools/smart-sparse-diff.py sparse.log ~/output/sparse.log | tee -a ~/output/sparse-diff.log + + - name: Archive artifacts + uses: actions/upload-artifact@v4 + with: + name: sparse-${{ matrix.defconfig }}-${{ matrix.image }}.log + path: | + ~/output/sparse.log + ~/output/sparse-diff.log diff --git a/.github/workflows/powerpc-update.yml b/.github/workflows/powerpc-update.yml new file mode 100644 index 0000000000000..9b9fe9dc960fc --- /dev/null +++ b/.github/workflows/powerpc-update.yml @@ -0,0 +1,38 @@ +name: powerpc/update + +# Controls when the action will run. +on: + # update at 2am AEST == 4pm UTC + schedule: + - cron: '0 16 * * *' + # This allows the build to be triggered manually via the github UI. + workflow_dispatch: + +jobs: + update: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Fetch linux-next + run: | + git fetch https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git + git branch -f linux-next FETCH_HEAD + + - name: Rebase + run: | + git config user.name "linuxppc" + git config user.email "linuxppc@github.com" + # We need to fetch another commit so HEAD^ will work + git fetch --deepen=1 origin + # Rebase tip of main (current branch) onto linux-next + git rebase --onto linux-next HEAD^ + # Get next datestamp + date=$(git log -1 --format=%s linux-next | tr -d "[A-Za-z\- ]") + # Update commit subject + git commit --amend -m "CI: Add CI configuration to linux-next $date" + + - name: Push + run: | + # Push back to main + git push -f origin main:main diff --git a/README.md b/README.md new file mode 100644 index 0000000000000..9f087ee2a6760 --- /dev/null +++ b/README.md @@ -0,0 +1,5 @@ +# linuxppc linux-next CI + +This repository only exists to automatically run CI jobs on linux-next. + +See the [Actions](https://github.com/linuxppc/linux-next-ci/actions) tab for results. diff --git a/arch/powerpc/configs/g5-qemu.config b/arch/powerpc/configs/g5-qemu.config new file mode 100644 index 0000000000000..3ae1c8a8bc61f --- /dev/null +++ b/arch/powerpc/configs/g5-qemu.config @@ -0,0 +1,2 @@ +CONFIG_SERIAL_PMACZILOG=y +CONFIG_SERIAL_PMACZILOG_CONSOLE=y diff --git a/arch/powerpc/configs/pmac32-qemu.config b/arch/powerpc/configs/pmac32-qemu.config new file mode 100644 index 0000000000000..81d3a24b2169e --- /dev/null +++ b/arch/powerpc/configs/pmac32-qemu.config @@ -0,0 +1,5 @@ +CONFIG_SERIAL_PMACZILOG=y +CONFIG_SERIAL_PMACZILOG_CONSOLE=y +CONFIG_DEVTMPFS=y +CONFIG_DEVTMPFS_MOUNT=y +CONFIG_DEBUG_ATOMIC_SLEEP=y diff --git a/arch/powerpc/configs/ppc44x-qemu.config b/arch/powerpc/configs/ppc44x-qemu.config new file mode 100644 index 0000000000000..5e9cf983acc7d --- /dev/null +++ b/arch/powerpc/configs/ppc44x-qemu.config @@ -0,0 +1,2 @@ +CONFIG_DEVTMPFS=y +CONFIG_DEVTMPFS_MOUNT=y diff --git a/arch/powerpc/tools/ci-build.sh b/arch/powerpc/tools/ci-build.sh new file mode 100755 index 0000000000000..8fb81f4515548 --- /dev/null +++ b/arch/powerpc/tools/ci-build.sh @@ -0,0 +1,85 @@ +#!/bin/bash + +if [[ -z "$TARGET" || -z "$IMAGE" ]]; then + echo "Error: required environment variables not set!" + exit 1 +fi + +cmd="docker run --rm " +cmd+="--network none " +cmd+="-w /linux " + +linux_dir=$(realpath $(dirname $0))/../../../ +cmd+="-v $linux_dir:/linux:ro " + +cmd+="-e ARCH " +cmd+="-e JFACTOR=$(nproc) " +cmd+="-e KBUILD_BUILD_TIMESTAMP=$(date +%Y-%m-%d) " +cmd+="-e VERBOSE " +cmd+="-e CLANG " +cmd+="-e LLVM_IAS " +cmd+="-e SPARSE " + +if [[ -n "$MODULES" ]]; then + cmd+="-e MODULES=$MODULES " +fi + +if [[ -n "$DEFCONFIG" ]]; then + if [[ $DEFCONFIG != *config ]]; then + DEFCONFIG=${DEFCONFIG}_defconfig + fi + + cmd+="-e DEFCONFIG=${DEFCONFIG} " +fi + +if [[ -n "$MERGE_CONFIG" ]]; then + cmd+="-e MERGE_CONFIG=$MERGE_CONFIG " +fi + +if [[ "$SUBARCH" == "ppc64le" ]]; then + cross="powerpc64le-linux-gnu-" +else + cross="powerpc-linux-gnu-" +fi +cmd+="-e CROSS_COMPILE=$cross " + +mkdir -p $HOME/output +cmd+="-v $HOME/output:/output:rw " + +user=$(stat -c "%u:%g" $HOME/output) +cmd+="-u $user " + +if [[ -n "$CCACHE" ]]; then + cmd+="-v $HOME/.ccache:/ccache:rw " + cmd+="-e CCACHE_DIR=/ccache " + cmd+="-e CCACHE=1 " +fi + +if [[ -n "$TARGETS" ]]; then + cmd+="-e TARGETS=$TARGETS " +fi + +if [[ -n "$INSTALL" ]]; then + cmd+="-e INSTALL=$INSTALL " +fi + +if [[ "$TARGET" == "kernel" ]]; then + cmd+="-e QUIET=1 " +fi + +if [[ -n $KBUILD_EXTRA_WARN ]]; then + cmd+="-e KBUILD_EXTRA_WARN=$KBUILD_EXTRA_WARN " +fi + +cmd+="ghcr.io/linuxppc/build:$IMAGE-$(uname -m) " +cmd+="/bin/container-build.sh $TARGET" + +(set -x; $cmd) + +rc=$? + +if [[ -n "$SPARSE" ]]; then + cat $HOME/output/sparse.log +fi + +exit $rc