mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-12 16:24:04 +00:00
* queue.yml: remove TENANCY_VERSION env var from test.sh * add DisallowSqliteAttach feature * Fix code style (php-cs-fixer) * ci: add cd to each step * ci: simpler solution to race conditions, proper os/arch matrix * ci: fix runs-on matrix * ci: fix workflow on windows, fix makefile * Auto-build: Update extensions [skip ci] * Auto-build: Update extensions [skip ci] * ci: try fixing retry logic, make makefile use cl on Windows * ci: use the current branch for rebase * ci: try calling vcvars64 * ci: misc minor fixes * ci: try fixing c compiler on windows * ci: misc minor fixes * ci: add debug steps * ci: try to fix windows build * ci: try using clang on windows * ci: windows fixes, makefile fix * Auto-build: Update extensions [skip ci] * ci: dont produce .exp .lib on Windows * ci: try forcing shell: bash on commit step * ci: try to get linux cross-compilation working * ci: reformulate condition * ci: fix syntax error * ci: correct debian image name * Auto-build: Update extensions [skip ci] * ci: try to set up macOS cross-compilation * ci: add ARCH variable to makefile, override it during cross-compilation * Auto-build: Update extensions [skip ci] * ci: X64 -> x64 * ci: only trigger extensions.yml on pushes to extensions/ * fix tests on x64 * ci: try using bash for pushing on windows; ignore phpstan error * fix test failing in ci but passing locally * bump php version in composer.json, trigger extensions.yml build * remove comment * noattach: more explicit return values, avoid potential non-bool return values * makefile: use -Os on Windows * ci: use make -B * ci: try triggering extensions build on extensions.yml file changes * Auto-build: Update extensions [skip ci] * Auto-build: Update extensions [skip ci] * ci: remove windows linker flag, use a whitelist for git add * Auto-build: Update extensions [skip ci] * Auto-build: Update extensions [skip ci] * Auto-build: Update extensions [skip ci] * fix path in feature class, minor refactor * Fix code style (php-cs-fixer) --------- Co-authored-by: PHP CS Fixer <phpcsfixer@example.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
102 lines
3.1 KiB
YAML
102 lines
3.1 KiB
YAML
name: Build extensions
|
|
|
|
on:
|
|
push:
|
|
paths:
|
|
- 'extensions/**'
|
|
- '.github/workflows/extensions.yml'
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
build:
|
|
strategy:
|
|
matrix:
|
|
include:
|
|
- os: ubuntu-latest
|
|
arch: x64
|
|
- os: ubuntu-latest
|
|
arch: ARM64
|
|
- os: windows-latest
|
|
arch: x64
|
|
- os: macos-latest
|
|
arch: x64
|
|
- os: macos-latest
|
|
arch: ARM64
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Download SQLite headers (Unix)
|
|
if: runner.os != 'Windows'
|
|
run: cd extensions && make headers
|
|
|
|
- name: Download SQLite headers (Windows)
|
|
if: runner.os == 'Windows'
|
|
run: |
|
|
cd extensions
|
|
curl.exe -L https://www.sqlite.org/2024/sqlite-amalgamation-3470200.zip -o sqlite-src.zip
|
|
Expand-Archive -Path sqlite-src.zip -DestinationPath .
|
|
Copy-Item sqlite-amalgamation-3470200\sqlite3.h .
|
|
Copy-Item sqlite-amalgamation-3470200\sqlite3ext.h .
|
|
|
|
- name: Set up QEMU (Linux cross-compilation)
|
|
if: runner.os == 'Linux' && matrix.arch == 'ARM64'
|
|
uses: docker/setup-qemu-action@v3
|
|
|
|
- name: Build C files (Native Windows)
|
|
if: runner.os == 'Windows'
|
|
run: cd extensions && make -B
|
|
|
|
- name: Build C files (Native Linux)
|
|
if: runner.os == 'Linux' && matrix.arch == 'x64'
|
|
run: cd extensions && make -B
|
|
|
|
- name: Build C files (Linux cross-compilation)
|
|
if: runner.os == 'Linux' && matrix.arch == 'ARM64'
|
|
run: |
|
|
cd extensions
|
|
docker run --platform linux/arm64 \
|
|
-v .:/extensions \
|
|
debian:bookworm-slim \
|
|
bash -c "apt-get update && apt-get install -y make gcc && cd /extensions && make"
|
|
|
|
- name: Build C files (Native macOS ARM64)
|
|
if: matrix.os == 'macos-latest' && matrix.arch == 'ARM64'
|
|
run: cd extensions && make -B
|
|
|
|
- name: Build C files (macOS cross-compilation)
|
|
if: matrix.os == 'macos-latest' && matrix.arch == 'x64'
|
|
run: |
|
|
cd extensions
|
|
brew install llvm
|
|
export CC=/opt/homebrew/opt/llvm/bin/clang
|
|
export CFLAGS="-target x86_64-apple-darwin"
|
|
export LDFLAGS="-target x86_64-apple-darwin"
|
|
make -B ARCH=x86_64
|
|
|
|
- name: Commit output files
|
|
shell: bash
|
|
run: |
|
|
cd extensions
|
|
git config --local user.email "github-actions[bot]@users.noreply.github.com"
|
|
git config --local user.name "github-actions[bot]"
|
|
git add lib/*.{so,dylib,dll} lib/arm/*.{so,dylib}
|
|
git commit -m "Auto-build: Update extensions [skip ci]" || echo "No changes to commit"
|
|
|
|
- name: Push files
|
|
shell: bash
|
|
run: |
|
|
CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
|
|
for attempt in {1..3}; do
|
|
git pull --rebase origin $CURRENT_BRANCH && git push origin $CURRENT_BRANCH && exit 0 || {
|
|
echo "Attempt $attempt failed. Retrying in 5 seconds..."
|
|
sleep 5
|
|
}
|
|
done
|
|
|
|
echo "Failed to push changes after 3 attempts."
|
|
exit 1
|