Skip to content

Commit

Permalink
chore: Bump Pskel v1.0.0 (#23)
Browse files Browse the repository at this point in the history
* chore: bump Pskel v1.0.0
* restore build and library test
  • Loading branch information
zeriyoshi authored Aug 23, 2024
1 parent b672ca8 commit a2cc1ef
Show file tree
Hide file tree
Showing 21 changed files with 519 additions and 310 deletions.
35 changes: 14 additions & 21 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,16 @@
{
"name": "colopl_bc_dev",
"build": {
"args": {
"IMAGE": "php",
"TAG": "8.3-cli"
}
},
"customizations": {
"vscode": {
"extensions": [
"ms-vscode.cpptools",
"ms-vscode.cpptools-extension-pack",
"maelvalais.autoconf"
]
}
},
"context": "../",
"dockerFile": "../Dockerfile",
"runArgs": [ "--cap-add=SYS_PTRACE", "--security-opt", "seccomp=unconfined" ],
"workspaceFolder": "/usr/src/php/ext/extension",
"workspaceMount": "source=./ext,target=/usr/src/php/ext/extension,type=bind,consistency=cached"
"name": "Pskel (for Codespaces)",
"customizations": {
"vscode": {
"extensions": [
"ms-vscode.cpptools",
"ms-vscode.cpptools-extension-pack",
"maelvalais.autoconf",
"ms-azuretools.vscode-docker",
"editorconfig.editorconfig"
]
}
},
"dockerComposeFile": "./../compose.yaml",
"service": "shell"
}
20 changes: 20 additions & 0 deletions .devcontainer/local/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"name": "Pskel (for Local)",
"customizations": {
"vscode": {
"extensions": [
"ms-vscode.cpptools",
"ms-vscode.cpptools-extension-pack",
"maelvalais.autoconf",
"ms-azuretools.vscode-docker",
"editorconfig.editorconfig"
]
}
},
"dockerComposeFile": "./../../compose.yaml",
"service": "shell",
"mounts": [
"source=${localWorkspaceFolder},target=/workspaces/pskel,type=bind,consistency=cached"
],
"workspaceFolder": "/workspaces/pskel"
}
5 changes: 4 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
.git
**/.git
**/README.md
**/LICENSE
**/.editorconfig
46 changes: 46 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# https://editorconfig.org/

root = true

[*]
trim_trailing_whitespace = true
insert_final_newline = true
end_of_line = lf
charset = utf-8
tab_width = 4

[{*.{awk,bat,c,cpp,d,dasc,h,l,re,skl,w32,y},Makefile*}]
indent_size = 4
indent_style = tab

[*.{dtd,html,inc,php,phpt,rng,wsdl,xml,xsd,xsl}]
indent_size = 4
indent_style = space

[*.{ac,m4,sh,yml}]
indent_size = 2
indent_style = space

[*.md]
indent_style = space
max_line_length = 80

[COMMIT_EDITMSG]
indent_size = 4
indent_style = space
max_line_length = 80

[*.patch]
trim_trailing_whitespace = false

[*.json]
indent_size = 2
indent_style = space

[compose.yaml]
indent_size = 2
indent_style = space

[Dockerfile]
indent_size = 2
indent_style = space
9 changes: 1 addition & 8 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,10 @@
version: 2
updates:
- package-ecosystem: "composer"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
day: "saturday"
- package-ecosystem: "docker"
directory: "/"
schedule:
interval: "weekly"
day: "saturday"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
day: "saturday"
17 changes: 17 additions & 0 deletions .github/octocov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
coverage:
paths:
- ../lcov.info
acceptable: current >= 60%
testExecutionTime:
if: false
comment:
if: is_pull_request
diff:
datastores:
- artifact://${GITHUB_REPOSITORY}
comment:
if: is_pull_request
report:
if: is_default_branch
datastores:
- artifact://${GITHUB_REPOSITORY}
52 changes: 31 additions & 21 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,28 @@
name: CI
on: [push, pull_request]
on:
push:
branches:
- main
pull_request:
schedule:
- cron: '0 0 * * 1'
permissions:
contents: write
pull-requests: write
jobs:
CI:
runs-on: ubuntu-22.04
timeout-minutes: 60
Linux:
runs-on: ubuntu-latest
strategy:
matrix:
arch: ["amd64", "arm64v8", "s390x"]
version: ["8.1", "8.2", "8.3"]
type: ["cli", "zts"]
distro: ["bookworm", "alpine"]
platform: ['linux/amd64', 'linux/arm64/v8', 'linux/s390x']
version: ['8.1', '8.2', '8.3']
type: ['cli', 'zts']
distro: ['bookworm', 'alpine']
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true
- name: Setup QEMU
uses: docker/setup-qemu-action@v3
with:
Expand All @@ -21,27 +31,27 @@ jobs:
uses: docker/setup-buildx-action@v3
- name: Build container
run: |
docker compose build --pull --no-cache --build-arg IMAGE=${{ matrix.arch }}/php --build-arg TAG=${{ matrix.version }}-${{ matrix.type }}-${{ matrix.distro }} --build-arg PSKEL_SKIP_DEBUG=${{ matrix.arch != 'amd64' && '1' || '' }}
- name: Run tests
docker compose build --pull --no-cache --build-arg PLATFORM="${{ matrix.platform }}" --build-arg IMAGE="php" --build-arg TAG="${{ matrix.version }}-${{ matrix.type }}-${{ matrix.distro }}"
- name: Test extension with Bundled PHP + PHP library test
run: |
docker compose run --rm --entrypoint=/usr/bin/ci --env TEST_EXTENSION=1 dev
docker compose run --rm shell library_test
- name: Test extension with PHP Debug Build
if: matrix.arch == 'amd64'
if: matrix.platform == 'linux/amd64'
run: |
docker compose run --rm --entrypoint=/usr/bin/ci --env TEST_EXTENSION_DEBUG=1 dev
docker compose run --rm shell pskel test debug
- name: Test extension with Valgrind
if: matrix.arch == 'amd64'
if: matrix.platform == 'linux/amd64'
run: |
docker compose run --rm --entrypoint=/usr/bin/ci --env TEST_EXTENSION_VALGRIND=1 dev
docker compose run --rm shell pskel test valgrind
- name: Test extension with LLVM Sanitizer (MemorySanitizer)
if: matrix.arch == 'amd64' && matrix.distro != 'alpine'
if: matrix.platform == 'linux/amd64' && matrix.distro != 'alpine'
run: |
docker compose run --rm --entrypoint=/usr/bin/ci --env TEST_EXTENSION_MSAN=1 dev
docker compose run --rm shell pskel test msan
- name: Test extension with LLVM Sanitizer (AddressSanitizer)
if: matrix.arch == 'amd64' && matrix.distro != 'alpine'
if: matrix.platform == 'linux/amd64' && matrix.distro != 'alpine'
run: |
docker compose run --rm --entrypoint=/usr/bin/ci --env TEST_EXTENSION_ASAN=1 dev
docker compose run --rm shell pskel test asan
- name: Test extension with LLVM Sanitizer (UndefinedBehaviorSanitizer)
if: matrix.arch == 'amd64' && matrix.distro != 'alpine' && matrix.version != '8.1'
if: matrix.platform == 'linux/amd64' && matrix.distro != 'alpine'
run: |
docker compose run --rm --entrypoint=/usr/bin/ci --env TEST_EXTENSION_UBSAN=1 dev
docker compose run --rm shell pskel test ubsan
65 changes: 65 additions & 0 deletions .github/workflows/coverage.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Coverage
permissions:
contents: write
pull-requests: write
on:
push:
branches:
- main
pull_request:
types:
- opened
- synchronize
- reopened
jobs:
Linux:
runs-on: ubuntu-latest
strategy:
matrix:
version: ['8.3']
type: ['cli', 'zts']
distro: ['bookworm']
outputs:
matrix: ${{ toJson(matrix) }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true
- name: Setup buildx
uses: docker/setup-buildx-action@v3
- name: Build container
run: |
docker compose build --pull --no-cache --build-arg PLATFORM="linux/amd64" --build-arg IMAGE="php" --build-arg TAG="${{ matrix.version }}-${{ matrix.type }}-${{ matrix.distro }}"
- name: Test with gcov
run: |
docker compose run -v "$(pwd)/ext:/ext" --rm shell pskel coverage
- name: Upload coverage to artifact
uses: actions/upload-artifact@v4
with:
name: coverage-${{ matrix.version }}-${{ matrix.type }}-${{ matrix.distro }}
path: ${{ github.workspace }}/ext/lcov.info
Coverage:
needs: [Linux]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download coverage artifacts
uses: actions/download-artifact@v4
- name: Merge coverages
run: |
sudo apt-get install -y "lcov"
LCOV_FILES="$(find . -name "lcov.info")"
CMD="$(which "lcov")"
for LCOV_FILE in ${LCOV_FILES}; do
CMD+=" -a ${LCOV_FILE}"
done
CMD+=" -o lcov.info"
echo "Merging coverages: ${LCOV_FILES}"
${CMD}
- name: Report coverage
uses: k1LoW/octocov-action@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
config: .github/octocov.yml
9 changes: 4 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/artifacts
/vendor
composer.lock
.phpunit.result.cache
*.DS_Store
/ext/*.dep
/ext/*~
*.DS_Store
lcov.info
21 changes: 21 additions & 0 deletions .vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"configurations": [
{
"name": "Linux",
"includePath": [
"${workspaceFolder}/**",
"/usr/local/include/php",
"/usr/local/include/php/TSRM",
"/usr/local/include/php/Zend",
"/usr/local/include/php/ext",
"/usr/local/include/php/include",
"/usr/local/include/php/main",
"/usr/local/include/php/sapi"
],
"defines": [],
"compilerPath": "/usr/bin/gcc",
"cStandard": "c99"
}
],
"version": 4
}
7 changes: 7 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"files.associations": {
"*.phpt": "php",
"*.c": "c",
"*.h": "c"
}
}
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# 11.0.2-dev
- Add official support for PHP 8.3
- Upgrade pskel

# 11.0.1
- More strict bundled tests
Expand Down
Loading

0 comments on commit a2cc1ef

Please sign in to comment.