Merge pull request #768 from micmac1/github-sync-with-packages

CI: sync up with changes in packages repo
This commit is contained in:
Jiri Slachta 2022-05-31 21:45:53 +02:00 committed by GitHub
commit 1fc2c77420
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 94 additions and 43 deletions

View 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 Issues related to releases below 18.06 and forks are not supported or maintained and will be closed.
- LEDE: https://bugs.lede-project.org/
- Most LuCI packages: https://github.com/openwrt/luci/issues
Thanks for your contribution # Issue template (remove lines from top till here)
Please remove this text (before ---) and fill the following template
-------------------------------
Maintainer: @<github-user> (find it by checking history of the package Makefile) Maintainer: @\<github-user> (find it by checking history of the package Makefile)
Environment: (put here arch, model, OpenWRT/LEDE version) Environment: (put here arch, model, OpenWrt version)
Description: Description:
``` ```
Formating code blocks by wrapping them with pairs of ``` Format code blocks by wrapping them with pairs of ```
``` ```

View file

@ -1,16 +1,5 @@
Please double check that your commits: Maintainer: me / @\<github-user> (find it by checking history of the package Makefile)
- all start with "<package name>: " Compile tested: (put here arch, model, OpenWrt version)
- all contain signed-off-by Run tested: (put here arch, model, OpenWrt version, tests done)
- 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)
Description: Description:

View file

@ -1,5 +1,5 @@
ARG ARCH=x86-64 ARG ARCH=x86-64
FROM openwrtorg/rootfs:$ARCH FROM openwrt/rootfs:$ARCH
ADD entrypoint.sh /entrypoint.sh ADD entrypoint.sh /entrypoint.sh

View file

@ -26,7 +26,7 @@ for PKG in /ci/*.ipk; do
if [ -f "$TEST_SCRIPT" ]; then if [ -f "$TEST_SCRIPT" ]; then
echo "Use package specific test.sh" echo "Use package specific test.sh"
if sh "$TEST_SCRIPT" "$PKG_NAME" "$PKG_VERSION"; then if sh "$TEST_SCRIPT" "$PKG_NAME" "$PKG_VERSION"; then
echo "Test succesful" echo "Test successful"
else else
echo "Test failed" echo "Test failed"
exit 1 exit 1

View file

@ -10,21 +10,45 @@ jobs:
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
arch:
- arc_archs
- arm_cortex-a9_vfpv3-d16
- mips_24kc
- powerpc_464fp
- powerpc_8540
runtime_test: [false]
include: 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 - arch: aarch64_cortex-a53
target: mvebu-cortexa53
runtime_test: true runtime_test: true
- arch: arm_cortex-a15_neon-vfpv4 - arch: arm_cortex-a15_neon-vfpv4
target: armvirt-32
runtime_test: true runtime_test: true
- arch: i386_pentium-mmx - arch: i386_pentium-mmx
target: x86-geode
runtime_test: true runtime_test: true
- arch: x86_64 - arch: x86_64
target: x86-64
runtime_test: true runtime_test: true
steps: steps:
@ -41,8 +65,10 @@ jobs:
- name: Determine changed packages - name: Determine changed packages
run: | run: |
# only detect packages with changes # only detect packages with changes
PKG_ROOTS=$(find . -name Makefile | grep -v ".*/src/Makefile" | sed -e 's@./\(.*\)/Makefile@\1/@') PKG_ROOTS=$(find . -name Makefile | \
CHANGES=$(git diff --diff-filter=d --name-only origin/$BRANCH) 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 ROOT in $PKG_ROOTS; do
for CHANGE in $CHANGES; do for CHANGE in $CHANGES; do
@ -55,13 +81,13 @@ jobs:
# fallback to test packages if nothing explicitly changes this is # fallback to test packages if nothing explicitly changes this is
# should run if other mechanics in packages.git changed # should run if other mechanics in packages.git changed
PACKAGES="${PACKAGES:-vim tmux bmon}" PACKAGES="${PACKAGES:-vim attendedsysupgrade-common bmon}"
echo "Building $PACKAGES" echo "Building $PACKAGES"
echo "PACKAGES=$PACKAGES" >> $GITHUB_ENV echo "PACKAGES=$PACKAGES" >> $GITHUB_ENV
- name: Build - name: Build
uses: openwrt/gh-action-sdk@v1 uses: openwrt/gh-action-sdk@v5
env: env:
ARCH: ${{ matrix.arch }}-${{ env.BRANCH }} ARCH: ${{ matrix.arch }}-${{ env.BRANCH }}
FEEDNAME: packages_ci FEEDNAME: packages_ci
@ -69,17 +95,57 @@ jobs:
- name: Move created packages to project dir - name: Move created packages to project dir
run: cp bin/packages/${{ matrix.arch }}/packages_ci/*.ipk . || true 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 - name: Store packages
uses: actions/upload-artifact@v2 uses: actions/upload-artifact@v2
with: with:
name: ${{ matrix.arch}}-packages name: ${{env.ARCHIVE_NAME}}-packages
path: "*.ipk" path: |
*.ipk
PKG-INFO
- name: Store logs - name: Store logs
uses: actions/upload-artifact@v2 uses: actions/upload-artifact@v2
with: with:
name: ${{ matrix.arch}}-logs name: ${{env.ARCHIVE_NAME}}-logs
path: logs/ path: |
logs/
PKG-INFO
- name: Remove logs - name: Remove logs
run: sudo rm -rf logs/ || true run: sudo rm -rf logs/ || true
@ -94,7 +160,7 @@ jobs:
run: | run: |
docker build -t test-container --build-arg ARCH .github/workflows/ docker build -t test-container --build-arg ARCH .github/workflows/
env: env:
ARCH: ${{ matrix.arch }} ARCH: ${{ matrix.arch }}-${{ env.BRANCH }}
- name: Test via Docker container - name: Test via Docker container
if: ${{ matrix.runtime_test }} if: ${{ matrix.runtime_test }}