diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 90a85fd..9e667df 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -39,3 +39,38 @@ jobs: - name: Verify logs saved run: find artifacts/logs/package/feeds/packages/ -mindepth 2 -maxdepth 2 -name compile.txt -type f | grep . + + try_options: # To test options such as FIXUP + name: Option FIXUP=${{ matrix.fixup }} + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + release: + - master + arch: # arch and release variants are tested above, so limit these here + - x86_64 + fixup: + - 1 + - 0 + + steps: + - uses: actions/checkout@v4 + + - name: Add test directories + run: mkdir artifacts feed + + - name: Build + uses: ./ + env: + ARCH: ${{ matrix.arch }}-${{ matrix.release }} + ARTIFACTS_DIR: ${{ github.workspace }}/artifacts + FEED_DIR: ${{ github.workspace }}/feed + PACKAGES: privoxy + FIXUP: ${{ matrix.fixup }} + + - name: Verify packages saved + run: find artifacts/bin/packages/${{ matrix.arch }}/packages/ -maxdepth 1 -name '*.ipk' -type f | grep . + + - name: Verify logs saved + run: find artifacts/logs/package/feeds/packages/ -mindepth 2 -maxdepth 2 -name compile.txt -type f | grep . diff --git a/README.md b/README.md index 0144af8..bdd48b1 100644 --- a/README.md +++ b/README.md @@ -69,3 +69,5 @@ The action reads a few env variables: * `NO_SHFMT_CHECK` disable check if init files are formated * `PACKAGES` (Optional) specify the list of packages (space separated) to be built * `V` changes the build verbosity level. +* `FIXUP` set to `1` to [generate](https://openwrt.org/docs/guide-developer/packages#use_source_repository) the `PKG_MIRROR_HASH`, and for other [fixes](https://openwrt.org/docs/guide-developer/packages#testing_a_package_makefile). Only used when `PACKAGES` option is used. + diff --git a/action.yml b/action.yml index c5636cd..abab059 100644 --- a/action.yml +++ b/action.yml @@ -44,6 +44,7 @@ runs: --env PACKAGES \ --env INDEX \ --env V \ + --env FIXUP \ -v ${{ steps.inputs.outputs.artifacts_dir }}:/artifacts \ -v ${{ steps.inputs.outputs.feed_dir }}:/feed \ sdk diff --git a/entrypoint.sh b/entrypoint.sh index 2e2a15e..1290174 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -90,10 +90,17 @@ else endgroup group "make package/$PKG/check" + if [ "${FIXUP+defined}" ] && [ "$FIXUP" -eq 1 ]; then + echo "FIXUP=1 is set, so PKG_MIRROR_HASH might be generated" + : # FIXUP=1 is set. Do nothing. It will get used below. + else + # In all other cases, avoid mention of FIXUP to build scripts. + unset FIXUP + fi make \ BUILD_LOG="$BUILD_LOG" \ IGNORE_ERRORS="$IGNORE_ERRORS" \ - "package/$PKG/check" V=s 2>&1 | \ + "package/$PKG/check" ${FIXUP:+FIXUP=$FIXUP} V=s 2>&1 | \ tee logtmp endgroup