Skip to content
Merged
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
109 changes: 109 additions & 0 deletions .github/workflows/scheduled-e2e.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
name: Scheduled E2E

on:
schedule:
- cron: '17 3 * * 1'
workflow_dispatch:

env:
PKGR_VERSION: c87a5d00a3a7c4c0887161c8000cc7df8734ebed

jobs:
recipes:
runs-on: ubuntu-24.04
timeout-minutes: 180
strategy:
fail-fast: false
matrix:
target:
- debian:11
- debian:12
- debian:13
- ubuntu:20.04
- ubuntu:22.04
- ubuntu:24.04
- ubuntu:26.04
- el:8
- el:9
- el:10
- sles:12
- sles:15
- sles:16
steps:
- uses: actions/checkout@v5
- name: Resolve the pkgr revision
id: pkgr
run: |
revision="$PKGR_VERSION"
if [[ ! "$revision" =~ ^[0-9a-f]{40}$ ]]; then
revision=$(git ls-remote https://github.com/crohr/pkgr.git refs/heads/master | cut -f1)
fi
echo "revision=$revision" >> "$GITHUB_OUTPUT"
- name: Exercise local recipes and warm cache hits
run: node package/e2e/recipes.js
env:
TARGET: ${{ matrix.target }}
PKGR_REVISION: ${{ steps.pkgr.outputs.revision }}

applications:
runs-on: ubuntu-24.04
timeout-minutes: 90
strategy:
fail-fast: false
matrix:
target:
- debian:11
- debian:12
- debian:13
- ubuntu:20.04
- ubuntu:22.04
- ubuntu:24.04
- ubuntu:26.04
- el:8
- el:9
- el:10
- sles:12
- sles:15
- sles:16
language: [ruby, node, python]
steps:
- uses: actions/checkout@v5
- name: Select legacy runtime versions
if: matrix.target == 'el:8' || matrix.target == 'sles:12'
run: |
sed -i 's/ruby "3.3.10"/ruby "2.7.7"/' package/e2e/fixtures/ruby/Gemfile
sed -i 's/ruby 3.3.10p0/ruby 2.7.7p0/; s/ 2.7.2/ 2.4.22/' package/e2e/fixtures/ruby/Gemfile.lock
if [ '${{ matrix.target }}' = 'sles:12' ]; then
sed -i 's/24.13.0/16.18.1/' package/e2e/fixtures/node/package.json
fi
- uses: ./package
id: package
with:
target: ${{ matrix.target }}
name: pkgr-e2e-${{ matrix.language }}
version: '1.0.0'
path: package/e2e/fixtures/${{ matrix.language }}
pkgr_version: ${{ env.PKGR_VERSION }}
cache_prefix: scheduled-${{ matrix.target }}-${{ matrix.language }}
debug: true
- name: Assert and install the native package
run: |
test -f '${{ steps.package.outputs.package_path }}'
ruby_version=3.3.10
node_version=24.13.0
if [ '${{ matrix.target }}' = 'el:8' ] || [ '${{ matrix.target }}' = 'sles:12' ]; then
ruby_version=2.7.7
fi
if [ '${{ matrix.target }}' = 'sles:12' ]; then
node_version=16.18.1
fi
case '${{ matrix.language }}' in
ruby) expected="ruby $ruby_version" ;;
node) expected="node $node_version" ;;
python) expected='python 3.10.8' ;;
esac
package/e2e/install-package.sh \
'${{ matrix.target }}' \
'barebuild/${{ matrix.target }}' \
'${{ steps.package.outputs.package_path }}' \
"pkgr-e2e-${{ matrix.language }} | grep -F '$expected'"
102 changes: 67 additions & 35 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,50 +1,82 @@
name: Test

on:
pull_request:
push:
workflow_dispatch:

env:
REPOSITORY: crohr/blank-noop-app
jobs:
test:
timeout-minutes: 30
name: ${{ matrix.target }}
runs-on: ubuntu-latest
strategy:
matrix:
target:
- debian:13
- ubuntu:24.04
- el:9
- sles:15
PKGR_VERSION: c87a5d00a3a7c4c0887161c8000cc7df8734ebed

jobs:
unit:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v5
- uses: actions/setup-node@v4
with:
path: action
node-version: 24
cache: npm
cache-dependency-path: package/package-lock.json
- run: npm ci
working-directory: package
- run: npm test
working-directory: package
- run: npm run build
working-directory: package
- name: Verify generated action bundle
run: git diff --exit-code -- package/dist

recipes:
needs: unit
runs-on: ubuntu-24.04
timeout-minutes: 180
steps:
- uses: actions/checkout@v5
with:
repository: ${{ env.REPOSITORY }}
ref: master
path: app
- uses: ./action/package
- name: Resolve the pkgr revision
id: pkgr
run: |
revision="$PKGR_VERSION"
if [[ ! "$revision" =~ ^[0-9a-f]{40}$ ]]; then
revision=$(git ls-remote https://github.com/crohr/pkgr.git refs/heads/master | cut -f1)
fi
echo "revision=$revision" >> "$GITHUB_OUTPUT"
- name: Exercise local recipes and warm cache hits
run: node package/e2e/recipes.js
env:
TARGET: ubuntu:24.04
PKGR_REVISION: ${{ steps.pkgr.outputs.revision }}

applications:
needs: unit
runs-on: ubuntu-24.04
timeout-minutes: 90
strategy:
fail-fast: false
matrix:
language: [ruby, node, python]
steps:
- uses: actions/checkout@v5
- uses: ./package
id: package
with:
target: ${{ matrix.target }}
name: blank-noop-app
target: ubuntu:24.04
name: pkgr-e2e-${{ matrix.language }}
version: '1.0.0'
path: app
path: package/e2e/fixtures/${{ matrix.language }}
pkgr_version: ${{ env.PKGR_VERSION }}
cache_prefix: e2e-${{ matrix.language }}
debug: true
- name: Upload
uses: actions/upload-artifact@v4
with:
name: ${{ steps.package.outputs.package_name }}
path: ${{ steps.package.outputs.package_path }}
- name: Publish
uses: ./action/publish
with:
target: ${{ matrix.target }}
token: ${{ secrets.PACKAGER_PUBLISH_TOKEN }}
repository: ${{ env.REPOSITORY }}
channel: ${{ github.ref_name }}
file: ${{ steps.package.outputs.package_path }}
- name: Assert and install the native package
run: |
test -f '${{ steps.package.outputs.package_path }}'
case '${{ matrix.language }}' in
ruby) expected='ruby 3.3.10' ;;
node) expected='node 24.13.0' ;;
python) expected='python 3.10.8' ;;
esac
package/e2e/install-package.sh \
ubuntu:24.04 \
'barebuild/ubuntu:24.04' \
'${{ steps.package.outputs.package_path }}' \
"pkgr-e2e-${{ matrix.language }} | grep -F '$expected'"
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

GitHub Action for packaging apps as DEB or RPM. Should be used as a replacement for [Packager.io](https://packager.io) hosted service.

The package action builds missing Ruby, Node, and Python toolchains locally. It caches each toolchain independently from the application build cache. No hosted `buildcurl.com` or `barebuild.com` compiler is required.

Local toolchain builds require a Linux AMD64 Docker runner with host networking. GitHub-hosted Ubuntu runners and conventional Linux Docker hosts are supported. Docker Desktop and restricted or rootless Docker daemons are not supported.

## Usage

### Building Packages
Expand Down
2 changes: 2 additions & 0 deletions package/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,5 @@ outputs:
runs:
using: 'node24'
main: 'dist/index.js'
post: 'dist/cleanup/index.js'
post-if: 'always()'
Loading
Loading