parent
2aafefafb2
commit
35806f9853
4 changed files with 218 additions and 0 deletions
32
.forgejo/workflows/7.4.yml
Normal file
32
.forgejo/workflows/7.4.yml
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
name: CI
|
||||
|
||||
on:
|
||||
push:
|
||||
|
||||
jobs:
|
||||
build-deb:
|
||||
runs-on: docker
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Build
|
||||
uses: ./
|
||||
with:
|
||||
php-version: '7.4'
|
||||
sqlcipher-version: '4.12.0'
|
||||
tz: 'UTC'
|
||||
|
||||
- name: Notify on failure
|
||||
if: ${{ failure() }}
|
||||
env:
|
||||
WEBHOOK_URL: ${{ secrets.NODERED_WEBHOOK_URL }}
|
||||
REPOSITORY: ${{ forgejo.repository }}
|
||||
RUN_NUMBER: ${{ forgejo.run_number }}
|
||||
SERVER_URL: ${{ forgejo.server_url }}
|
||||
run: |
|
||||
curl -X POST \
|
||||
-H "Content-Type: application/json" \
|
||||
-d "{\"repository\":\"$REPOSITORY\",\"run_number\":\"$RUN_NUMBER\",\"status\":\"failure\",\"url\":\"$SERVER_URL/$REPOSITORY/actions/runs/$RUN_NUMBER\"}" \
|
||||
"$WEBHOOK_URL"
|
||||
32
.forgejo/workflows/8.2.yml
Normal file
32
.forgejo/workflows/8.2.yml
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
name: CI
|
||||
|
||||
on:
|
||||
push:
|
||||
|
||||
jobs:
|
||||
build-deb:
|
||||
runs-on: docker
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Build
|
||||
uses: ./
|
||||
with:
|
||||
php-version: '8.2'
|
||||
sqlcipher-version: '4.12.0'
|
||||
tz: 'UTC'
|
||||
|
||||
- name: Notify on failure
|
||||
if: ${{ failure() }}
|
||||
env:
|
||||
WEBHOOK_URL: ${{ secrets.NODERED_WEBHOOK_URL }}
|
||||
REPOSITORY: ${{ forgejo.repository }}
|
||||
RUN_NUMBER: ${{ forgejo.run_number }}
|
||||
SERVER_URL: ${{ forgejo.server_url }}
|
||||
run: |
|
||||
curl -X POST \
|
||||
-H "Content-Type: application/json" \
|
||||
-d "{\"repository\":\"$REPOSITORY\",\"run_number\":\"$RUN_NUMBER\",\"status\":\"failure\",\"url\":\"$SERVER_URL/$REPOSITORY/actions/runs/$RUN_NUMBER\"}" \
|
||||
"$WEBHOOK_URL"
|
||||
32
.forgejo/workflows/8.4.yml
Normal file
32
.forgejo/workflows/8.4.yml
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
name: CI
|
||||
|
||||
on:
|
||||
push:
|
||||
|
||||
jobs:
|
||||
build-deb:
|
||||
runs-on: docker
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Build
|
||||
uses: ./
|
||||
with:
|
||||
php-version: '8.4'
|
||||
sqlcipher-version: '4.12.0'
|
||||
tz: 'UTC'
|
||||
|
||||
- name: Notify on failure
|
||||
if: ${{ failure() }}
|
||||
env:
|
||||
WEBHOOK_URL: ${{ secrets.NODERED_WEBHOOK_URL }}
|
||||
REPOSITORY: ${{ forgejo.repository }}
|
||||
RUN_NUMBER: ${{ forgejo.run_number }}
|
||||
SERVER_URL: ${{ forgejo.server_url }}
|
||||
run: |
|
||||
curl -X POST \
|
||||
-H "Content-Type: application/json" \
|
||||
-d "{\"repository\":\"$REPOSITORY\",\"run_number\":\"$RUN_NUMBER\",\"status\":\"failure\",\"url\":\"$SERVER_URL/$REPOSITORY/actions/runs/$RUN_NUMBER\"}" \
|
||||
"$WEBHOOK_URL"
|
||||
122
actions.yml
Normal file
122
actions.yml
Normal file
|
|
@ -0,0 +1,122 @@
|
|||
name: Build php-pdo-sqlcipher Debian package
|
||||
description: Build and test php-pdo-sqlcipher .deb using dpkg-buildpackage + autopkgtest on Debian
|
||||
|
||||
inputs:
|
||||
php-version:
|
||||
description: PHP version to build against (e.g. 8.2)
|
||||
default: '8.2'
|
||||
sqlcipher-version:
|
||||
description: SQLCipher tag (without the leading v)
|
||||
default: '4.12.0'
|
||||
tz:
|
||||
description: Timezone
|
||||
default: 'UTC'
|
||||
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- name: Set up APT and build dependencies
|
||||
shell: bash
|
||||
env:
|
||||
DEBIAN_FRONTEND: noninteractive
|
||||
TZ: ${{ inputs.tz }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
|
||||
apt-get update
|
||||
apt-get install -y --no-install-recommends \
|
||||
apt-transport-https apt-utils autoconf autopkgtest build-essential \
|
||||
ca-certificates curl dpkg-dev devscripts debhelper dh-php pkg-php-tools \
|
||||
git gnupg pkg-config \
|
||||
libicu-dev libreadline-dev libssl-dev libsqlite3-dev libtool \
|
||||
lintian lsb-release tcl-dev
|
||||
|
||||
- name: Configure PHP APT sources
|
||||
shell: bash
|
||||
env:
|
||||
TZ: ${{ inputs.tz }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
# scripts/ lives in the repo; when used as a local action, this path is correct
|
||||
./scripts/setup-php-sources.sh
|
||||
|
||||
- name: Install PHP build-deps
|
||||
shell: bash
|
||||
env:
|
||||
DEBIAN_FRONTEND: noninteractive
|
||||
PHP_VER: ${{ inputs.php-version }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
apt-get update
|
||||
apt-get build-dep -y "php${PHP_VER}"
|
||||
|
||||
- name: Ensure PHP CLI with docs for autopkgtest
|
||||
shell: bash
|
||||
env:
|
||||
DEBIAN_FRONTEND: noninteractive
|
||||
PHP_VER: ${{ inputs.php-version }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
|
||||
# Make sure docs are not excluded, autopkgtest needs examples
|
||||
rm -f /etc/dpkg/dpkg.cfg.d/docker /etc/dpkg/dpkg.cfg.d/excludes || true
|
||||
printf 'path-include=/usr/share/doc/*\n' > /etc/dpkg/dpkg.cfg.d/01-include-docs
|
||||
|
||||
apt-get update
|
||||
apt-get install -y --no-install-recommends "php${PHP_VER}-cli"
|
||||
|
||||
- name: Fetch upstream sources (sqlcipher, pdo_sqlcipher, PHP)
|
||||
shell: bash
|
||||
env:
|
||||
PHP_VER: ${{ inputs.php-version }}
|
||||
SQLCIPHER_VERSION: ${{ inputs.sqlcipher-version }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
cd "$GITHUB_WORKSPACE"
|
||||
|
||||
# match Dockerfile layout in /work/src
|
||||
git clone --branch "v${SQLCIPHER_VERSION}" --depth 1 \
|
||||
https://github.com/sqlcipher/sqlcipher.git build-sqlcipher
|
||||
|
||||
git clone --branch main --depth 1 \
|
||||
https://git.mig5.net/mig5/pdo_sqlcipher.git
|
||||
|
||||
mkdir -p php-src
|
||||
cd php-src
|
||||
apt-get -y source "php${PHP_VER}"
|
||||
|
||||
- name: Render Debian files and build package
|
||||
shell: bash
|
||||
env:
|
||||
PHP_VER: ${{ inputs.php-version }}
|
||||
SQLCIPHER_VERSION: ${{ inputs.sqlcipher-version }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
cd "$GITHUB_WORKSPACE"
|
||||
|
||||
umask 022
|
||||
./scripts/render-debian-files.sh
|
||||
|
||||
dpkg-buildpackage -us -uc -b -rfakeroot
|
||||
|
||||
. /etc/os-release
|
||||
lintian -i -E --pedantic --profile "${ID}" --fail-on error ../*.changes
|
||||
|
||||
- name: Run autopkgtest on built package
|
||||
shell: bash
|
||||
run: |
|
||||
set -euo pipefail
|
||||
cd "$GITHUB_WORKSPACE"
|
||||
|
||||
pkg=$(ls -1 ../*.deb | grep -v dbgsym | head -n1)
|
||||
echo "Testing package: $pkg"
|
||||
autopkgtest "$pkg" -- null
|
||||
|
||||
- name: Collect artifacts
|
||||
shell: bash
|
||||
run: |
|
||||
set -euo pipefail
|
||||
cd "$GITHUB_WORKSPACE"
|
||||
|
||||
mkdir -p dist
|
||||
cp -a ../*.deb ../*.buildinfo ../*.changes dist/ || true
|
||||
Loading…
Add table
Add a link
Reference in a new issue