From 815e7c3df1621170150c60ee6a500d9904658e3d Mon Sep 17 00:00:00 2001 From: Jan Lindemann Date: Sat, 14 Feb 2026 12:13:54 +0100 Subject: [PATCH] Add action.yml and reusable.yaml. This action allows to test packaging of projects compatible with the jw-pkg layout. It attempts the following steps: - Clones, builds and installs jw-pkg from source - Clones the package under test from Git - Installs its build prerequisites - Builds, packages and installs it Additionally, a reusable workflow .github/workflows/reusable.yaml is added to invoke it for all supported distributions, which currently are Kali Linux and OpenSUSE. Signed-off-by: Jan Lindemann --- .github/workflows/reusable.yaml | 20 ++++++++++++++++++++ action.yml | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100644 .github/workflows/reusable.yaml create mode 100644 action.yml diff --git a/.github/workflows/reusable.yaml b/.github/workflows/reusable.yaml new file mode 100644 index 0000000..80154b9 --- /dev/null +++ b/.github/workflows/reusable.yaml @@ -0,0 +1,20 @@ +name: Reusable packaging test job + +on: + workflow_call: + +jobs: + test: + runs-on: public-ci + strategy: + fail-fast: false + matrix: + distro: + - { image: "registry.janware.com/public/ci/runner/opensuse/tumbleweed:latest", name: "OpenSUSE Tumbleweed" } + - { image: "registry.janware.com/public/ci/runner/kali/rolling:latest", name: "Kali Linux" } + + container: + image: ${{ matrix.distro.image }} + + steps: + - uses: ci/action-build-package@master diff --git a/action.yml b/action.yml new file mode 100644 index 0000000..9b026d4 --- /dev/null +++ b/action.yml @@ -0,0 +1,33 @@ +name: jw-pkg packaging test +description: Checkout, build and test a project organized with jw-pkg + +runs: + using: composite + steps: + - uses: ci/action-checkout@main-jw + with: + path: ${{ github.event.repository.name }} + working-directory: ${{ github.event.repository.name }} + persist-credentials: false + - name: Install build prerequisites + shell: bash + run: | + set -euxo pipefail + # Install from source what's publicly available. This step could be omitted. + ( + export PROJECTS_DIR_REMOTE_BASE=${{ github.server_url }} + owner=janware + makefile=$PROJECTS_DIR_REMOTE_BASE/$owner/jw-pkg/raw/branch/master/make/projects-dir-minimal.mk + curl --create-dirs -o build-jw-foss/Makefile $makefile + make -C build-jw-foss pkg-install-release-deps + OFFLINE=true make -C build-jw-foss pkg-rebuild-reinstall + ) + + - name: Build and install package + shell: bash + run: | + set -ex + make -C ${{ github.event.repository.name }} pkg-manager-refresh # redundant + make -C ${{ github.event.repository.name }} pkg-install-testbuild-deps # redundant + make -C ${{ github.event.repository.name }} pkg-rebuild + make -C ${{ github.event.repository.name }} pkg-reinstall