-
Notifications
You must be signed in to change notification settings - Fork 89
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
GitHub actions #190
Merged
NoiseByNorthwest
merged 24 commits into
NoiseByNorthwest:master
from
AlexNDRmac:github-actions
May 17, 2022
Merged
GitHub actions #190
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
019448f
Add initial CI workflow
AlexNDRmac 4f6c1d6
Fix workflow syntax
AlexNDRmac 50ac7bb
Fix install step
AlexNDRmac 7089afb
Add failure scenario
AlexNDRmac b4de294
Add spx to ini
AlexNDRmac d19024e
Add macOS to build metrix
AlexNDRmac 0e91923
Fix metrix name
AlexNDRmac 16fa28e
Use macos 11 for runners
AlexNDRmac ce4ef7e
Add zlib for macos
AlexNDRmac f59b441
Pass zlib to configure script for macOS
AlexNDRmac 8af0e99
Fix bash syntax
AlexNDRmac c250d84
Try old php
AlexNDRmac dbe4097
Enable all php version
AlexNDRmac 82bb5ca
Add ini file for CI, add test ENV vars
AlexNDRmac b461c05
Move spx.ini to proper place
AlexNDRmac dc02b5e
Use sudo for copying
AlexNDRmac ef0482e
Disable test ini file, use dynamic loading for ext
AlexNDRmac b956b47
Replace CI status badge
AlexNDRmac 0cc138b
Add build artifact
AlexNDRmac 3568c4a
Fix matrix name for Ubuntu
AlexNDRmac 6070f72
Create zip with build artifact
AlexNDRmac 7bf6e21
Add LICENSE to readme, simplify badges links
AlexNDRmac b173809
Add release action
AlexNDRmac cd55bec
Add CHANGELOG with parser
AlexNDRmac File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/usr/bin/env bash | ||
|
||
# -e Exit immediately if a command exits with a non-zero status. | ||
# -u Treat unset variables as an error when substituting. | ||
|
||
set -eu | ||
set -o pipefail | ||
|
||
# Get Release notes for the latest release from CHANGELOG.md | ||
# How to use: | ||
# release-notes.sh CHANGELOG.md > ReleaseNotes.md | ||
|
||
startline=$(($(cat "$1" | grep -nE '^## \[v[0-9]+' | head -n 1 | tail -n 1 | cut -d ":" -f 1) + 1)) | ||
finishline=$(($(cat "$1" | grep -nE '^## \[v[0-9]+' | head -n 2 | tail -n 1 | cut -d ":" -f 1) - 1)) | ||
changelog=$(sed -n "${startline},${finishline}p" "$1"); | ||
|
||
echo "${changelog}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,146 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
paths-ignore: | ||
- '**.md' | ||
- '**.txt' | ||
pull_request: | ||
|
||
jobs: | ||
build: | ||
name: build / php-${{ matrix.php }}-${{ matrix.ts }}-${{ matrix.name }}-${{ matrix.compiler }} | ||
|
||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
php: [ '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1' ] | ||
|
||
name: | ||
- linux | ||
- mac | ||
|
||
include: | ||
# Linux | ||
- { name: linux, ts: 'nts', compiler: 'gcc', os: ubuntu-20.04 } | ||
# macOS | ||
- { name: mac, ts: 'nts', compiler: 'clang', os: macos-11 } | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
# configure spx artifact name in next format: | ||
# {php}-{ts}-{os.name}-{compiler} | ||
# spx-php-8.1-nts-Linux-gcc | ||
- name: Set artifact name | ||
id: setup-artifact | ||
run: | | ||
echo "::set-output name=spx_file_name::spx-php-${{ matrix.php }}-${{ matrix.ts }}-${{ matrix.name }}-${{ matrix.compiler }}" | ||
|
||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php }} | ||
|
||
- name: Install dependencies | ||
if: runner.os == 'macOS' | ||
run: brew install zlib | ||
|
||
- name: phpize | ||
run: phpize | ||
|
||
- name: Configure | ||
run: | | ||
if [ "${{ runner.os }}" = "macOS" ]; then | ||
./configure --with-zlib-dir=$(brew --prefix)/opt/zlib | ||
else | ||
./configure | ||
fi | ||
|
||
- name: Compile | ||
run: | | ||
make -j"$(getconf _NPROCESSORS_ONLN)" | ||
sudo make install | ||
|
||
- name: Extension Info | ||
run: | | ||
php --ini | ||
php -d extension=./modules/spx.so --ri spx | ||
|
||
- name: Run Tests | ||
run: make test | ||
env: | ||
NO_INTERACTION: 1 | ||
REPORT_EXIT_STATUS: 1 | ||
TEST_PHP_ARGS: "--show-diff" | ||
|
||
- name: Upload build artifacts after Failure | ||
if: failure() | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: debug-${{ steps.setup-artifact.outputs.spx_file_name }} | ||
path: | | ||
${{ github.workspace }}/*.log | ||
${{ github.workspace }}/tests/*.log | ||
retention-days: 7 | ||
|
||
- name: Create ZIP archive with build artifact | ||
run: | | ||
zip -rvj ${{ steps.setup-artifact.outputs.spx_file_name }}.zip \ | ||
./modules/spx.so LICENSE $ZIP_EXCLUDE | ||
zip -rv ${{ steps.setup-artifact.outputs.spx_file_name }}.zip \ | ||
./assets $ZIP_EXCLUDE | ||
env: | ||
ZIP_EXCLUDE: -x ".*" -x "__MACOSX" -x "*.DS_Store" | ||
|
||
- name: Check Release notes | ||
run: | | ||
echo "-- Parsing Release Notes from CHANGELOG" | ||
./.github/release-notes.sh ./CHANGELOG.md | ||
|
||
- name: Upload build artifact | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: ${{ steps.setup-artifact.outputs.spx_file_name }} | ||
path: ${{ steps.setup-artifact.outputs.spx_file_name }}.zip | ||
|
||
release: | ||
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') | ||
|
||
needs: [ build ] | ||
name: Create Release | ||
runs-on: ubuntu-20.04 | ||
|
||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 1 | ||
|
||
- name: Get the release version | ||
id: get-version | ||
run: | | ||
echo ::set-output name=version::${GITHUB_REF#refs/tags/} | ||
|
||
- name: Download SPX build artifacts | ||
id: download | ||
uses: actions/download-artifact@v2 | ||
with: | ||
path: ./build-artifacts | ||
|
||
- name: Prepare Release notes | ||
run: | | ||
echo "-- Creating Release Notes" | ||
./.github/release-notes.sh ./CHANGELOG.md > ./release-notes.md | ||
|
||
- name: Create Release | ||
uses: ncipollo/release-action@v1 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
name: ${{ steps.get-version.outputs.version }} | ||
tag: ${{ steps.get-version.outputs.version }} | ||
bodyFile: "./release-notes.md" | ||
allowUpdates: true | ||
artifacts: "./build-artifacts/*.zip" | ||
artifactContentType: application/octet-stream |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
# Change Log | ||
All notable changes to this project will be documented in this file. | ||
|
||
The format is based on [Keep a Changelog](http://keepachangelog.com/) | ||
and this project adheres to [Semantic Versioning](http://semver.org/). | ||
|
||
## [Unreleased](https://github.com/NoiseByNorthwest/php-spx/compare/0.4.0...HEAD) | ||
|
||
### Added | ||
- Github Actions workflow ([#180](https://github.com/NoiseByNorthwest/php-spx/issues/180)) | ||
|
||
### Removed | ||
- Travis CI | ||
|
||
|
||
## [v0.4.0](https://github.com/NoiseByNorthwest/php-spx/compare/0.3.0...0.4.0) | ||
|
||
### Added | ||
- Analysis screen: fix the NaNs in time grid when time goes above 1000s (fixes [#65](https://github.com/NoiseByNorthwest/php-spx/issues/65)) | ||
- Add sampling profiling mode ([#69](https://github.com/NoiseByNorthwest/php-spx/pull/69)) | ||
- Add memory allocator related metrics ([#70](https://github.com/NoiseByNorthwest/php-spx/pull/70)) | ||
- CLI: Add color scheme to flat profile ([#77](https://github.com/NoiseByNorthwest/php-spx/pull/77)) | ||
- Add PHP 7.3 support ([#80](https://github.com/NoiseByNorthwest/php-spx/pull/80)) | ||
|
||
### Changed | ||
- Web UI: remove request-URI based routing ([#76](https://github.com/NoiseByNorthwest/php-spx/pull/76)) | ||
|
||
### Fixed | ||
- Fix build on macOS 10.11- (fixes [#78](https://github.com/NoiseByNorthwest/php-spx/pull/78)) | ||
|
||
|
||
## [v0.3.0](https://github.com/NoiseByNorthwest/php-spx/compare/0.2.0...0.3.0) | ||
|
||
### Added | ||
- Improve documentation around web UI requirements (fixes [#54](https://github.com/NoiseByNorthwest/php-spx/issues/54)) | ||
- Web UI: Add custom color scheme management (@orls [#46](https://github.com/NoiseByNorthwest/php-spx/pull/46)) | ||
- Control panel: output command line prefix according to current setup | ||
- Analysis screen: improve loading performance a bit | ||
- Analysis screen: improve loading progress dialog | ||
- Analysis screen: add cumulative cost computation and fix flat profile | ||
- percentage columns (fixes [#41](https://github.com/NoiseByNorthwest/php-spx/issues/41)) | ||
- Analysis screen: display bars in flat profile percentage columns (fixes [#40](https://github.com/NoiseByNorthwest/php-spx/issues/40)) | ||
- Add request shutdown tracing | ||
- Add script compilation tracing | ||
- Metrics: add GC run count | ||
- Metrics: add GC collected cycles count | ||
- Metrics: add included file count | ||
- Metrics: add included line count | ||
- Metrics: add user class count | ||
- Metrics: add user function count | ||
- Metrics: add user opcode count | ||
|
||
### Fixed | ||
- Fix ownership issue (to stick to PHP coding standard) | ||
- Fix call of non reentrant `exit()` function in a signal handler (fixes [#42](https://github.com/NoiseByNorthwest/php-spx/issues/42)) | ||
- Web UI / analysis screen: improved layout | ||
|
||
|
||
## [v0.2.0](https://github.com/NoiseByNorthwest/php-spx/compare/0.1.2...0.2.0) | ||
|
||
### Added | ||
- Add web UI ([#14](https://github.com/NoiseByNorthwest/php-spx/pull/14)) | ||
- Add cookie based settings ([#3](https://github.com/NoiseByNorthwest/php-spx/issues/3)) | ||
- Improve Linux timer precision (1us -> 1ns) | ||
- Improve accuracy by evaluating and then substracting probes overhead | ||
|
||
## Changed | ||
- Remove Google Trace Event report type ([#10](https://github.com/NoiseByNorthwest/php-spx/issues/10)) | ||
- Remove Callgrind report type ([#11](https://github.com/NoiseByNorthwest/php-spx/issues/11)) | ||
|
||
|
||
## [v0.1.2](https://github.com/NoiseByNorthwest/php-spx/compare/0.1.2...0.1.2) | ||
|
||
### Added | ||
- Add macOS support ([orls](https://github.com/orls) in [#13](https://github.com/NoiseByNorthwest/php-spx/pull/13)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the point of this step in this context ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, to check that the script do not fail before entering the release process.