Skip to content

Commit

Permalink
Add pecl support. (#8)
Browse files Browse the repository at this point in the history
Co-authored-by: 何延龙 <hey.yanlong@gmail.com>
Co-authored-by: 吴晟 Wu Sheng <wu.sheng@foxmail.com>
  • Loading branch information
3 people authored Sep 7, 2022
1 parent 4231063 commit 59e6a4a
Show file tree
Hide file tree
Showing 12 changed files with 877 additions and 83 deletions.
75 changes: 75 additions & 0 deletions .github/workflows/pecl.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: PECL

on:
push:
branches:
- master
pull_request:
branches:
- "**"

env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: "1"
RUSTFLAGS: "-D warnings"
LLVM_CONFIG_PATH: llvm-config-10
RUSTUP_HOME: /opt/rustup
CARGO_HOME: /opt/cargo

jobs:
pecl:
name: PECL
strategy:
fail-fast: false
matrix:
os:
- ubuntu-20.04
version:
- php: "8.1"
swoole: "5.0.0"

runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: 'recursive'

- name: Install libclang
run: sudo apt-get install -y llvm-10-dev libclang-10-dev protobuf-compiler

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.version.php }}
tools: php-config
extensions: swoole-${{ matrix.version.swoole }}

- name: Install Rust Stable Globally
run: |
curl https://sh.rustup.rs -sSf | sh -s -- -y --no-modify-path
ln -s $CARGO_HOME/bin/rustup /usr/local/bin/rustup
ln -s $CARGO_HOME/bin/rustc /usr/local/bin/rustc
ln -s $CARGO_HOME/bin/cargo /usr/local/bin/cargo
- name: PECL install
run: |
sudo rustup default stable
sudo cargo run -p scripts --release -- create-package-xml --version 0.0.0 --notes "Just for TEST."
printf "\n" | sudo pecl install package.xml
php -d "extension=skywalking_agent" --ri skywalking_agent
20 changes: 17 additions & 3 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ jobs:
submodules: 'recursive'

- name: Install libclang
run: sudo apt-get install -y llvm-10-dev libclang-10-dev
run: sudo apt-get install -y llvm-10-dev libclang-10-dev protobuf-compiler

- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand Down Expand Up @@ -98,11 +98,25 @@ jobs:
command: clippy
args: --release

- name: Cargo build
uses: actions-rs/cargo@v1
with:
toolchain: stable
command: build
args: --release

- name: Docker compose
run: docker compose up -d

- name: Make test
run: make test
- name: Composer install
run: composer install --working-dir=tests/php

- name: Cargo test
uses: actions-rs/cargo@v1
with:
toolchain: stable
command: test
args: --release

fmt:
name: Fmt
Expand Down
44 changes: 44 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,47 @@
/.cargo/config.toml
# PHP composer vendor.
/tests/php/vendor/

/skywalking_agent-*.tgz
/package.xml

*.lo
*.la
.libs
acinclude.m4
aclocal.m4
autom4te.cache
build
config.guess
config.h
config.h.in
config.h.in~
config.log
config.nice
config.status
config.sub
configure
configure.ac
configure.in
include
install-sh
libtool
ltmain.sh
Makefile
Makefile.fragments
Makefile.global
Makefile.objects
missing
mkinstalldirs
modules
php_test_results_*.txt
phpt.*
run-test-info.php
run-tests.php
tests/**/*.diff
tests/**/*.out
tests/**/*.exp
tests/**/*.log
tests/**/*.db
tests/**/*.mem
tmp-php.ini
11 changes: 6 additions & 5 deletions .licenserc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,18 @@ header:
copyright-owner: Apache Software Foundation

paths-ignore:
- 'LICENSE'
- 'NOTICE'
- '**/*.md'
- '**/*.json'
- '**/*.lock'
- '**/*.md'
- '**/.gitignore'
- '**/.gitmodules'
- 'vendor'
- '.cargo'
- '.vscode'
- '.idea'
- '.vscode'
- 'LICENSE'
- 'NOTICE'
- 'config.m4'
- 'vendor'

comment: on-failure

Expand Down
Loading

0 comments on commit 59e6a4a

Please # to comment.