CI: sync up with changes in packages repo 768/head
authorSebastian Kemper <sebastian_ml@gmx.net>
Mon, 30 May 2022 16:45:58 +0000 (18:45 +0200)
committerSebastian Kemper <sebastian_ml@gmx.net>
Tue, 31 May 2022 19:29:41 +0000 (21:29 +0200)
Catch up with the changes in the packages repository. All changes are
manual cherry picks from the packages repo and listed below.

github: adapt templates

Remove refs to LEDE and use "OpenWrt" instead of "OpenWRT"

Remove instructions on self-checking pull request content for the
following considerations

 - The checks are now enforced by travis autocheck scripts
 - Github now prompts users to refer to the contributing guide on
   submitting new issue and pull request

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
(cherry picked from commit f552f738e2d4bb1fc15acde8b7410e3d37586e2f)

repo: Add more information to the issue template

Rephrase the template a bit and add information about
older releases and forks.

Signed-off-by: Daniel Engberg <daniel.engberg.lists@pyret.net>
(cherry picked from commit 31179ef2a414412871c1c23a9b3e506a5eab1ef8)

CI: use new `openwrt` Docker username

We now own `openwrtorg` and `openwrt`, where the latter replaces the
former. Slowly migrate over.

Signed-off-by: Paul Spooren <mail@aparcar.org>
(cherry picked from commit b164a3aa32caa181feff8074ecce3a42b052b060)

CI: define matrix individually and add targets

This allows more specific definition per test, like on which target
packages should be compiled.

Signed-off-by: Paul Spooren <mail@aparcar.org>
(cherry picked from commit 3701000051afe81c0f6c166a924828706cf21b05)

CI: reformat extra long line

Better readability on split screens.

Signed-off-by: Paul Spooren <mail@aparcar.org>
(cherry picked from commit 81f7461e66c877a9d1f6c751fd92252e950370c3)

CI: test build dependent packages

By using OPKGs `whatdepends` all packages dependent on a library are
printed. Use that feature to obtain packages which a version change may
break and build them as well.

Change "default" packages to contain a lib on which other packages
depend, instead of compiling `tmux` compile `attendedsysupgrade-common`
on which other packages depend.

Ignore any LuCI packages which only contains translations.

Signed-off-by: Paul Spooren <mail@aparcar.org>
(cherry picked from commit c0d0c64f6ca1cbed2586812cad9d7da7b6e5e542)

CI: revert adding of *depending* packages

While the idea may make sense the current implementation is faulty.
Problem is that OpenWrt uses the folder name of packages within the
build system while `opkg` spits out the actual packages names.

An example, compiling the packages of folder `vim` (`make
package/vim/compile`) creates a package called `xxd`, where `make
package/xxd/compile` would fail.

The current implementation uses `opkg` to figure out dependent packages,
but the resulting names do not match the above mentioned folders.

Revert this for now until we come up with a better implementation to
avoid false positive CI failures.

Signed-off-by: Paul Spooren <mail@aparcar.org>
(cherry picked from commit a2bda4cc69e4121dccba097578bbd0bd40d0675d)

github-ci: fix small typo

Signed-off-by: Michael Heimpold <mhei@heimpold.de>
(cherry picked from commit 05a3011b00f7128c5f46c2d05999937fc01dc2ca)

CI: update SDK action to v3

No also check mirror hashes and badly formated init files

Signed-off-by: Paul Spooren <mail@aparcar.org>
(cherry picked from commit 291d1f255abefbc05e53bb3019ed7a13e1826ef2)

github-ci: also build mipsel_24kc / mt7621

Signed-off-by: Kevin David <kevin.p.david@gmail.com>
This seems like a fairly popular configuration and is at least handy for me for temporary testing.

(cherry picked from commit a5de3d04557eccd1db58a35ab9f76b38eab4bfb4)

artifacts: use git commit sha in name

Signed-off-by: Peter van Dijk <peter.van.dijk@powerdns.com>
(cherry picked from commit bbf983721cf41fd94388b16ce90f018d6c0496f5)

CI: add PKG-INFO metadata file

Signed-off-by: Peter van Dijk <peter.van.dijk@powerdns.com>
(cherry picked from commit a40c1b3e442eccbf0619f06b473705f4a4a0ac6d)

CI: do not crash during PKG-INFO generation if there are no packages

Signed-off-by: Peter van Dijk <peter.van.dijk@powerdns.com>
(cherry picked from commit b5132de5cf4f7d0562445cf3c65f9f1a4bcb1bbf)

CI: fix runtime testing for non master branch

The runtime testing always ran on master branch aka snapshots since the
branch wasn't passed over to the container execution!

Signed-off-by: Paul Spooren <mail@aparcar.org>
(cherry picked from commit f535d770901674d7d9f3d8cd9abe566d9db63ebe)

ci: use openwrt/gh-action-sdk@v4

In order to use feeds from GH mirror for GH actions, thus saving a lot
of resources being wasted. While at it fix whitespace issue.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
(cherry picked from commit b1355832a05f96d96081044a90b4c9137eb15fad)

github: fix typo in issue template

Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
(cherry picked from commit ffdc2b09eada82dd563f23a9a51e4ef8e233920f)

ci: Look for changed packages in the PR branch only

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
(cherry picked from commit 6b2294ac379ecae55993a8faa583910423f620e7)

ci: Use openwrt/gh-action-sdk@v5

The previous build errors with v5 have been fixed. This version builds
packages as a normal user instead of as root.

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
(cherry picked from commit 37f9b77b01fd148c946dc313869602fb8203eaea)

Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
.github/issue_template
.github/pull_request_template
.github/workflows/Dockerfile
.github/workflows/entrypoint.sh
.github/workflows/multi-arch-test-build.yml

index 72ff537e4629ed4acb923599f1044d2871e63189..2b237e22d50d4fa8a67bf7b3e612fdc754c83a1b 100644 (file)
@@ -1,20 +1,16 @@
-Please make sure that the issue subject starts with `<package-name>: ` so that it's easily identifiable.
+Please make sure that the issue subject starts with `<package-name>: `
 
-This repo here is ONLY for packages maintained in this repo.  For base packages residing in the same repo as the build system and maintained by core devs, please consider opening tickets there for more timely responses
+Also make sure that the package is maintained in this repository and not in base which should be submitted at https://bugs.openwrt.org or in the LuCI repository which should be submitted at https://github.com/openwrt/luci/issues.
 
- - OpenWrt: https://dev.openwrt.org/newticket
- - LEDE: https://bugs.lede-project.org/
- - Most LuCI packages: https://github.com/openwrt/luci/issues
+Issues related to releases below 18.06 and forks are not supported or maintained and will be closed.
 
-Thanks for your contribution
-Please remove this text (before ---) and fill the following template
--------------------------------
+# Issue template (remove lines from top till here)
 
-Maintainer: @<github-user> (find it by checking history of the package Makefile)
-Environment: (put here arch, model, OpenWRT/LEDE version)
+Maintainer: @\<github-user> (find it by checking history of the package Makefile)
+Environment: (put here arch, model, OpenWrt version)
 
 Description:
 
 ```
-Formating code blocks by wrapping them with pairs of ```
+Format code blocks by wrapping them with pairs of ```
 ```
index 411475586a5540ad94c1cf7dfd3451392eb9e72f..4bc4af61ea84665783594f12697e73bdefb14f92 100644 (file)
@@ -1,16 +1,5 @@
-Please double check that your commits:
-- all start with "<package name>: "
-- all contain signed-off-by
-- are linked to your github account (you see your logo in front of them)
-
-Please also read https://github.com/openwrt/packages/blob/master/CONTRIBUTING.md
-
-Thanks for your contribution
-Please remove this text (before ---) and fill the following template
--------------------------------
-
-Maintainer: me / @<github-user>
-Compile tested: (put here arch, model, OpenWRT/LEDE version)
-Run tested: (put here arch, model, OpenWRT/LEDE version, tests done)
+Maintainer: me / @\<github-user> (find it by checking history of the package Makefile)
+Compile tested: (put here arch, model, OpenWrt version)
+Run tested: (put here arch, model, OpenWrt version, tests done)
 
 Description:
index aa269b778f50f66fb14b4bfd6c05911d6ce7e160..fbd17fc1f9537348ae1928d50f1cd8c18f0af9a9 100644 (file)
@@ -1,5 +1,5 @@
 ARG ARCH=x86-64
-FROM openwrtorg/rootfs:$ARCH
+FROM openwrt/rootfs:$ARCH
 
 ADD entrypoint.sh /entrypoint.sh
 
index d7d4ecd0eb542ae43306aec1b32eaeb84ee0ee7b..76041054736c8ed1ab14fe5781622681d3a8730b 100755 (executable)
@@ -26,7 +26,7 @@ for PKG in /ci/*.ipk; do
        if [ -f "$TEST_SCRIPT" ]; then
                echo "Use package specific test.sh"
                if sh "$TEST_SCRIPT" "$PKG_NAME" "$PKG_VERSION"; then
-                       echo "Test succesful"
+                       echo "Test successful"
                else
                        echo "Test failed"
                        exit 1
index cbd9663f8b8fe389acd23e3968fdfb8044514a39..f8a907b153f32278bd679c66930afaddea91980f 100644 (file)
@@ -10,21 +10,45 @@ jobs:
     strategy:
       fail-fast: false
       matrix:
-        arch:
-          - arc_archs
-          - arm_cortex-a9_vfpv3-d16
-          - mips_24kc
-          - powerpc_464fp
-          - powerpc_8540
-        runtime_test: [false]
         include:
+          - arch: arc_archs
+            target: archs38-generic
+            runtime_test: false
+
+          - arch: arm_cortex-a9_vfpv3-d16
+            target: mvebu-cortexa9
+            runtime_test: false
+
+          - arch: mips_24kc
+            target: ath79-generic
+            runtime_test: false
+
+          - arch: mipsel_24kc
+            target: mt7621
+            runtime_test: false
+
+          - arch: powerpc_464fp
+            target: apm821xx-nand
+            runtime_test: false
+
+          - arch: powerpc_8540
+            target: mpc85xx-p1010
+            runtime_test: false
+
           - arch: aarch64_cortex-a53
+            target: mvebu-cortexa53
             runtime_test: true
+
           - arch: arm_cortex-a15_neon-vfpv4
+            target: armvirt-32
             runtime_test: true
+
           - arch: i386_pentium-mmx
+            target: x86-geode
             runtime_test: true
+
           - arch: x86_64
+            target: x86-64
             runtime_test: true
 
     steps:
@@ -41,8 +65,10 @@ jobs:
       - name: Determine changed packages
         run: |
           # only detect packages with changes
-          PKG_ROOTS=$(find . -name Makefile | grep -v ".*/src/Makefile" | sed -e 's@./\(.*\)/Makefile@\1/@')
-          CHANGES=$(git diff --diff-filter=d --name-only origin/$BRANCH)
+          PKG_ROOTS=$(find . -name Makefile | \
+            grep -v ".*/src/Makefile" | \
+            sed -e 's@./\(.*\)/Makefile@\1/@')
+          CHANGES=$(git diff --diff-filter=d --name-only origin/$BRANCH...)
 
           for ROOT in $PKG_ROOTS; do
             for CHANGE in $CHANGES; do
@@ -55,13 +81,13 @@ jobs:
 
           # fallback to test packages if nothing explicitly changes this is
           # should run if other mechanics in packages.git changed
-          PACKAGES="${PACKAGES:-vim tmux bmon}"
+          PACKAGES="${PACKAGES:-vim attendedsysupgrade-common bmon}"
 
           echo "Building $PACKAGES"
           echo "PACKAGES=$PACKAGES" >> $GITHUB_ENV
 
       - name: Build
-        uses: openwrt/gh-action-sdk@v1
+        uses: openwrt/gh-action-sdk@v5
         env:
           ARCH: ${{ matrix.arch }}-${{ env.BRANCH }}
           FEEDNAME: packages_ci
@@ -69,17 +95,57 @@ jobs:
       - name: Move created packages to project dir
         run: cp bin/packages/${{ matrix.arch }}/packages_ci/*.ipk . || true
 
+      - name: Collect metadata
+        run: |
+          MERGE_ID=$(git rev-parse --short HEAD)
+          echo "MERGE_ID=$MERGE_ID" >> $GITHUB_ENV
+          echo "BASE_ID=$(git rev-parse --short HEAD^1)" >> $GITHUB_ENV
+          echo "HEAD_ID=$(git rev-parse --short HEAD^2)" >> $GITHUB_ENV
+          PRNUMBER=${GITHUB_REF_NAME%/merge}
+          echo "PRNUMBER=$PRNUMBER" >> $GITHUB_ENV
+          echo "ARCHIVE_NAME=${{matrix.arch}}-PR$PRNUMBER-$MERGE_ID" >> $GITHUB_ENV
+
+      - name: Generate metadata
+        run: |
+          cat << _EOF_ > PKG-INFO
+          Metadata-Version: 2.1
+          Name: ${{env.ARCHIVE_NAME}}
+          Version: $BRANCH
+          Author: $GITHUB_ACTOR
+          Home-page: $GITHUB_SERVER_URL/$GITHUB_REPOSITORY/pull/$PRNUMBER
+          Download-URL: $GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID
+          Summary: $PACKAGES
+          Platform: ${{ matrix.arch }}
+
+          Packages for OpenWrt $BRANCH running on ${{matrix.arch}}, built from PR $PRNUMBER
+          at commit $HEAD_ID, against $BRANCH at commit $BASE_ID, with merge SHA $MERGE_ID.
+
+          Modified packages:
+          _EOF_
+          for p in $PACKAGES
+          do
+            echo "  "$p >> PKG-INFO
+          done
+          echo >> PKG-INFO
+          echo Full file listing: >> PKG-INFO
+          ls -al *.ipk >> PKG-INFO || true
+          cat PKG-INFO
+
       - name: Store packages
         uses: actions/upload-artifact@v2
         with:
-          name: ${{ matrix.arch}}-packages
-          path: "*.ipk"
+          name: ${{env.ARCHIVE_NAME}}-packages
+          path: |
+            *.ipk
+            PKG-INFO
 
       - name: Store logs
         uses: actions/upload-artifact@v2
         with:
-          name: ${{ matrix.arch}}-logs
-          path: logs/
+          name: ${{env.ARCHIVE_NAME}}-logs
+          path: |
+            logs/
+            PKG-INFO
 
       - name: Remove logs
         run: sudo rm -rf logs/ || true
@@ -94,7 +160,7 @@ jobs:
         run: |
           docker build -t test-container --build-arg ARCH .github/workflows/
         env:
-          ARCH: ${{ matrix.arch }}
+          ARCH: ${{ matrix.arch }}-${{ env.BRANCH }}
 
       - name: Test via Docker container
         if: ${{ matrix.runtime_test }}