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

on:
schedule:
- cron: '17 3 * * 1'
workflow_dispatch:
inputs:
pkgr_version:
description: master or a full pkgr commit SHA
required: false
default: master

jobs:
resolve-pkgr:
runs-on: ubuntu-24.04
outputs:
version: ${{ steps.version.outputs.value }}
steps:
- name: Resolve the pkgr version
id: version
env:
REQUESTED_VERSION: ${{ inputs.pkgr_version || 'master' }}
run: |
version="$REQUESTED_VERSION"
if [[ "$version" = master ]]; then
version=$(git ls-remote https://github.com/pkgr/pkgr.git refs/heads/master | cut -f1)
fi
if [[ ! "$version" =~ ^[0-9a-f]{40}$ ]]; then
echo "pkgr_version must be master or a full commit SHA" >&2
exit 1
fi
echo "value=$version" >> "$GITHUB_OUTPUT"

recipes:
needs: resolve-pkgr
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
env:
PKGR_VERSION: ${{ needs.resolve-pkgr.outputs.version }}
steps:
- uses: actions/checkout@v5
- name: Exercise local recipes and warm cache hits
run: node package/e2e/recipes.js
env:
TARGET: ${{ matrix.target }}
PKGR_REVISION: ${{ needs.resolve-pkgr.outputs.version }}

applications:
needs: resolve-pkgr
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]
env:
PKGR_VERSION: ${{ needs.resolve-pkgr.outputs.version }}
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'"
120 changes: 85 additions & 35 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,50 +1,100 @@
name: Test

on:
pull_request:
push:
workflow_dispatch:
inputs:
pkgr_version:
description: master or a full pkgr commit SHA
required: false
default: master

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
resolve-pkgr:
runs-on: ubuntu-24.04
outputs:
version: ${{ steps.version.outputs.value }}
steps:
- name: Resolve the pkgr version
id: version
env:
REQUESTED_VERSION: ${{ inputs.pkgr_version || 'master' }}
run: |
version="$REQUESTED_VERSION"
if [[ "$version" = master ]]; then
version=$(git ls-remote https://github.com/pkgr/pkgr.git refs/heads/master | cut -f1)
fi
if [[ ! "$version" =~ ^[0-9a-f]{40}$ ]]; then
echo "pkgr_version must be master or a full commit SHA" >&2
exit 1
fi
echo "value=$version" >> "$GITHUB_OUTPUT"

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: [resolve-pkgr, unit]
runs-on: ubuntu-24.04
timeout-minutes: 180
env:
PKGR_VERSION: ${{ needs.resolve-pkgr.outputs.version }}
steps:
- uses: actions/checkout@v5
with:
repository: ${{ env.REPOSITORY }}
ref: master
path: app
- uses: ./action/package
- name: Exercise local recipes and warm cache hits
run: node package/e2e/recipes.js
env:
TARGET: ubuntu:24.04
PKGR_REVISION: ${{ needs.resolve-pkgr.outputs.version }}

applications:
needs: [resolve-pkgr, unit]
runs-on: ubuntu-24.04
timeout-minutes: 90
strategy:
fail-fast: false
matrix:
language: [ruby, node, python]
env:
PKGR_VERSION: ${{ needs.resolve-pkgr.outputs.version }}
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