Skip to content

CI Test #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name": "Pskel (for Codespaces)",
"customizations": {
"vscode": {
"extensions": [
"ms-vscode.cpptools",
"ms-vscode.cpptools-extension-pack",
"maelvalais.autoconf",
"ms-azuretools.vscode-docker",
"editorconfig.editorconfig",
"markis.code-coverage"
]
}
},
"dockerComposeFile": "./../compose.yaml",
"service": "shell"
}
21 changes: 21 additions & 0 deletions .devcontainer/local/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"name": "Pskel (for Local)",
"customizations": {
"vscode": {
"extensions": [
"ms-vscode.cpptools",
"ms-vscode.cpptools-extension-pack",
"maelvalais.autoconf",
"ms-azuretools.vscode-docker",
"editorconfig.editorconfig",
"markis.code-coverage"
]
}
},
"dockerComposeFile": "./../../compose.yaml",
"service": "shell",
"mounts": [
"source=${localWorkspaceFolder},target=/workspaces/pskel,type=bind,consistency=cached"
],
"workspaceFolder": "/workspaces/pskel"
}
4 changes: 4 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
**/.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
10 changes: 10 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
- package-ecosystem: "docker"
directory: "/"
schedule:
interval: "weekly"
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}
94 changes: 94 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
name: CI
on:
push:
branches:
- main
pull_request:
schedule:
- cron: '0 0 * * 1'
permissions:
contents: write
pull-requests: write
jobs:
Linux:
runs-on: ubuntu-latest
strategy:
matrix:
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:
platforms: "arm64,s390x"
- name: Setup buildx
uses: docker/setup-buildx-action@v3
- name: Build container
run: |
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
run: |
docker compose run --rm shell pskel test
- name: Test extension with PHP Debug Build
if: matrix.platform == 'linux/amd64'
run: |
docker compose run --rm shell pskel test debug
- name: Test extension with Valgrind
if: matrix.platform == 'linux/amd64'
run: |
docker compose run --rm shell pskel test valgrind
- name: Test extension with LLVM Sanitizer (MemorySanitizer)
if: matrix.platform == 'linux/amd64' && matrix.distro != 'alpine'
run: |
docker compose run --rm shell pskel test msan
- name: Test extension with LLVM Sanitizer (AddressSanitizer)
if: matrix.platform == 'linux/amd64' && matrix.distro != 'alpine'
run: |
docker compose run --rm shell pskel test asan
- name: Test extension with LLVM Sanitizer (UndefinedBehaviorSanitizer)
if: matrix.platform == 'linux/amd64' && matrix.distro != 'alpine'
run: |
docker compose run --rm shell pskel test ubsan
# Windows:
# runs-on: windows-2022
# defaults:
# run:
# shell: cmd
# strategy:
# matrix:
# platform: ["x64"]
# version: ["8.1", "8.2", "8.3"]
# ts: ["nts", "ts"]
# steps:
# - name: Checkout
# uses: actions/checkout@v4
# - name: Setup PHP
# id: setup-php
# uses: php/[email protected]
# with:
# platform: ${{ matrix.platform }}
# version: ${{ matrix.version }}
# ts: ${{ matrix.ts }}
# - name: Enable developer command prompt
# uses: ilammy/msvc-dev-cmd@v1
# with:
# platform: ${{ matrix.platform }}
# toolset: ${{ steps.setup-php.outputs.toolset }}
# - name: phpize
# working-directory: ext
# run: phpize
# - name: configure
# working-directory: ext
# run: configure --enable-SKELETON_NAME --with-prefix=${{ steps.setup-php.outputs.prefix }}
# - name: make
# working-directory: ext
# run: nmake
# - name: test
# working-directory: ext
# run: nmake test TESTS="--show-diff tests"
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
49 changes: 4 additions & 45 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,45 +1,4 @@
*.lo
*.la
*.dep
.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~
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/**/*.php
tests/**/*.exp
tests/**/*.log
tests/**/*.sh
tests/**/*.db
tests/**/*.mem
tmp-php.ini
xpass-*.tgz
/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
}
29 changes: 29 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"files.associations": {
"*.phpt": "php",
"*.c": "c",
"*.h": "c"
},
"files.exclude": {
"**/.git": true,
"**/.DS_Store": true,
"**/Thumbs.db": true,
"**/.libs": true,
"**/*.cache": true,
"ext/**/*.dep": true,
"ext/**/*.la": true,
"ext/**/*.lo": true,
"ext/build": true,
"ext/config.h": true,
"ext/config.h.*": true,
"ext/config.nice": true,
"ext/config.status": true,
"ext/configure.ac": true,
"ext/configure~": true,
"ext/libtool": true,
"ext/Makefile.*": true,
},
"markiscodecoverage.enableDecorations": true,
"markiscodecoverage.enableOnStartup": true,
"markiscodecoverage.searchCriteria": "ext/lcov.info"
}
Loading
Loading