Skip to content

Commit

Permalink
Extend PHP builds to github actions 3
Browse files Browse the repository at this point in the history
  • Loading branch information
SergeySeroshtan committed Apr 26, 2024
1 parent 1ad6962 commit 7445acd
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 9 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/build-linux-php.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: build-php-linux
on:
push:
branches:
- "**"
tags:
- "*"
jobs:
build-php:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
php-version: ["8.2", "8.3", "8.4"]
arch: [x86_64]
name: PHP ${{ matrix.php-version }} build on ${{ matrix.os }} for arch ${{ matrix.arch }}
steps:
- name: Install PHP ${{ matrix.php-version }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
- name: Check PHP Version
run: php -v
- uses: actions/checkout@v3
- name: Configure toolchain
run: |
cmake --version
python3 --version
pip3 list --outdated
pip3 install -U protobuf grpcio-tools
- name: Configure project
run: >
cmake -Cconfigs/php-config.cmake \
-DCMAKE_BUILD_TYPE=Release \
-DVIRGIL_PACKAGE_PLATFORM_ARCH=${{ matrix.arch }} \
-DVIRGIL_PACKAGE_LANGUAGE_VERSION=${{ matrix.php-version }} \
-DCPACK_OUTPUT_FILE_PREFIX=php \
-DENABLE_CLANGFORMAT=OFF \
-DED25519_REF10=OFF -DED25519_AMD64_RADIX_64_24K=ON \
-Bbuild -S.
- name: Build project
run: cmake --build build -- -j$(nproc)
- name: Test project
working-directory: build
run: ctest --verbose
- name: Package project
working-directory: build
run: cpack
- name: Attach artifacts to the release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: build/php/*.tar.gz
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
name: build-php
name: build-php-macos
on:
push:
branches:
- "**"
tags:
- "*"
jobs:
build-php:
build-php-macos:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
os: [macos-latest]
php-version: ["8.2", "8.3", "8.4"]
arch: [x86_64, arm64]
include:
- arch: x86_64
optimizations: -DED25519_REF10=OFF -DED25519_AMD64_RADIX_64_24K=ON
- os: macos-latest
arch: arm64
- arch: arm64
optimizations: -DED25519_REF10=ON
name: PHP ${{ matrix.php-version }} build on ${{ matrix.os }} for arch ${{ matrix.arch }}
steps:
Expand All @@ -31,21 +31,20 @@ jobs:
run: |
cmake --version
python3 --version
pip3 list --outdated
pip3 install -U protobuf grpcio-tools
php --version
pip3 install protobuf grpcio-tools
- name: Configure project
run: >
cmake -Cconfigs/php-config.cmake \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_OSX_ARCHITECTURES=${{ matrix.arch }} \
-DVIRGIL_PACKAGE_PLATFORM_ARCH=${{ matrix.arch }} \
-DVIRGIL_PACKAGE_LANGUAGE_VERSION=${{ matrix.php-version }} \
-DCPACK_OUTPUT_FILE_PREFIX=php \
-DENABLE_CLANGFORMAT=OFF \
${{ matrix.optimizations }} \
-Bbuild -S.
- name: Build project
run: cmake --build build -- -j$(nproc)
run: cmake --build build -- -j$(sysctl -n hw.physicalcpu)
- name: Test project
working-directory: build
run: ctest --verbose
Expand Down

0 comments on commit 7445acd

Please sign in to comment.