Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add FIXUP option, for automatic package hash. #40

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 .
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

1 change: 1 addition & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,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
Expand Down
9 changes: 8 additions & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,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

Expand Down
Loading