8 name: Test ${{ matrix.arch }}
14 - arch: arm_cortex-a9_vfpv3-d16
15 target: mvebu-cortexa9
30 - arch: aarch64_cortex-a53
31 target: mvebu-cortexa53
34 - arch: arm_cortex-a15_neon-vfpv4
38 - arch: i386_pentium-mmx
47 - uses: actions/checkout@v3
51 - name: Determine branch name
53 BRANCH="${GITHUB_BASE_REF#refs/heads/}"
54 echo "Building for $BRANCH"
55 echo "BRANCH=$BRANCH" >> $GITHUB_ENV
57 - name: Determine changed packages
59 # only detect packages with changes
60 PKG_ROOTS=$(find . -name Makefile | \
61 grep -v ".*/src/Makefile" | \
62 sed -e 's@./\(.*\)/Makefile@\1/@')
63 CHANGES=$(git diff --diff-filter=d --name-only origin/$BRANCH)
65 for ROOT in $PKG_ROOTS; do
66 for CHANGE in $CHANGES; do
67 if [[ "$CHANGE" == "$ROOT"* ]]; then
68 PACKAGES+=$(echo "$ROOT" | sed -e 's@\(.*\)/@\1 @')
74 # fallback to test packages if nothing explicitly changes this is
75 # should run if other mechanics in packages.git changed
76 PACKAGES="${PACKAGES:-bird2 cjdns olsrd}"
78 echo "Building $PACKAGES"
79 echo "PACKAGES=$PACKAGES" >> $GITHUB_ENV
81 - name: Generate build keys
84 sudo apt-get install -y signify-openbsd
85 signify-openbsd -G -n -c 'DO NOT USE - OpenWrt packages feed CI' -p packages_ci.pub -s packages_ci.sec
86 EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)
87 echo "KEY_BUILD<<$EOF" >> $GITHUB_ENV
88 cat packages_ci.sec >> $GITHUB_ENV
89 echo "$EOF" >> $GITHUB_ENV
92 uses: openwrt/gh-action-sdk@v5
94 ARCH: ${{ matrix.arch }}-${{ env.BRANCH }}
97 KEY_BUILD: ${{ env.KEY_BUILD }}
99 - name: Move created packages to project dir
100 run: cp bin/packages/${{ matrix.arch }}/packages_ci/* . || true
102 - name: Store packages
103 uses: actions/upload-artifact@v3
105 name: ${{env.ARCHIVE_NAME}}-packages
113 uses: actions/upload-artifact@v3
115 name: ${{ matrix.arch}}-logs
119 run: sudo rm -rf logs/ || true
121 - name: Check if any packages were built
123 if [ -n "$(find . -maxdepth 1 -type f -name '*.ipk' -print -quit)" ]; then
124 echo "Found *.ipk files"
127 echo "No *.ipk files found"
130 echo "HAVE_IPKS=$HAVE_IPKS" >> $GITHUB_ENV
132 - name: Register QEMU
133 if: ${{ matrix.runtime_test && fromJSON(env.HAVE_IPKS) }}
136 sudo apt-get install -y qemu-user-static binfmt-support
137 sudo update-binfmts --import
139 - name: Build Docker container
140 if: ${{ matrix.runtime_test && fromJSON(env.HAVE_IPKS) }}
142 docker build -t test-container --build-arg ARCH .github/workflows/
144 ARCH: ${{ matrix.arch }}-${{ env.BRANCH }}
146 - name: Test via Docker container
147 if: ${{ matrix.runtime_test && fromJSON(env.HAVE_IPKS) }}
149 docker run --rm -v $GITHUB_WORKSPACE:/ci test-container