Skip to content

Commit

Permalink
Install php dependencies (#26)
Browse files Browse the repository at this point in the history
* Added php dependencies into packages
  • Loading branch information
intuibase authored May 29, 2024
1 parent c9c2085 commit 7cfab56
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-native.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---

# Runs the build based on the provided files in test.yml
name: build
name: build-native

on:
workflow_call:
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/build-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ jobs:
with:
name: build-native-${{ matrix.arch }}
path: prod/native/_build/${{ matrix.arch }}-release/
- uses: actions/download-artifact@v4
with:
name: php-dependencies
path: prod/php/
- name: Build packages
run: |
mkdir -p "${PWD}/build/packages"
Expand Down
45 changes: 45 additions & 0 deletions .github/workflows/build-php-deps.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---

name: build-php-deps

on:
workflow_call: ~
workflow_dispatch: ~

jobs:
build-php-deps:
name: build-php-dependencies
runs-on: ubuntu-latest
timeout-minutes: 300
strategy:
fail-fast: false
env:
COMPOSER_ALLOW_SUPERUSER: 1
steps:
- uses: actions/checkout@v4
- name: Build PHP dependencies
run: |
uname -a
PHP_VERSIONS=( 80 81 82 83 )
for PHP_VERSION in "${PHP_VERSIONS[@]}"
do
mkdir -p "prod/php/vendor_${PHP_VERSION}"
docker run --rm \
-v ${PWD}:/sources \
-v ${PWD}/prod/php/vendor_${PHP_VERSION}:/sources/vendor \
-w /sources \
php:${PHP_VERSION:0:1}.${PHP_VERSION:1:1}-cli sh -c "apt-get update && apt-get install -y unzip && curl -sS https://getcomposer.org/installer | php -- --filename=composer --install-dir=/usr/local/bin && composer --ignore-platform-req=ext-opentelemetry --ignore-platform-req=ext-otel_instrumentation --no-dev install"
#TODO get licences from dependencies
rm composer.lock
done
- uses: actions/upload-artifact@v4
with:
name: php-dependencies
path: |
prod/php/vendor_*
12 changes: 8 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,18 @@ jobs:
build-native:
uses: ./.github/workflows/build-native.yml

setup-build-matrix:
uses: ./.github/workflows/build-arch-matrix-generator.yml
with:
build_arch: ${{ inputs.build_arch }}
# setup-build-matrix:
# uses: ./.github/workflows/build-arch-matrix-generator.yml
# with:
# build_arch: ${{ inputs.build_arch }}

build-php-deps:
uses: ./.github/workflows/build-php-deps.yml

build-packages:
needs:
- build-native
- build-php-deps
uses: ./.github/workflows/build-packages.yml

tests-phpt:
Expand Down

0 comments on commit 7cfab56

Please sign in to comment.