Update CI configuration #109
Workflow file for this run
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
name: Build Timecop | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
release: | |
types: [created] | |
jobs: | |
build: | |
name: PHP ${{ matrix.php-version }} (ZTS ${{ matrix.php-zts }}) | |
runs-on: ubuntu-22.04 | |
timeout-minutes: 30 | |
strategy: | |
fail-fast: false | |
matrix: | |
php-version: | |
- '5.6' | |
- '7.0' | |
- '7.1' | |
- '7.2' | |
- '7.3' | |
- '7.4' | |
- '8.0' | |
- '8.1' | |
- '8.2' | |
- '8.3' | |
php-zts: | |
- nts | |
- ts | |
exclude: | |
- php-version: '5.6' | |
php-zts: 'ts' | |
- php-version: '8.3' | |
php-zts: 'ts' | |
steps: | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php-version }} | |
coverage: none | |
env: | |
phpts: ${{ matrix.php-zts }} | |
- name: PHP version | |
run: | | |
php --version | |
- name: Set PHP_API | |
run: | | |
echo "PHP_API=$(php-config --phpapi)" >> $GITHUB_ENV | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Build | |
run: | | |
phpize | |
./configure | |
make | |
make test REPORT_EXIT_STATUS=1 NO_INTERACTION=1 TESTS="--show-all" | |
- name: Save artifact (NTS) | |
uses: actions/upload-artifact@v3 | |
if: matrix.php-zts == 'nts' | |
with: | |
name: timecop_${{ env.PHP_API }}.so | |
path: modules/timecop.so | |
if-no-files-found: error | |
- name: Save artifact (TS) | |
uses: actions/upload-artifact@v3 | |
if: matrix.php-zts == 'ts' | |
with: | |
name: timecop_${{ env.PHP_API }}_zts.so | |
path: modules/timecop.so | |
if-no-files-found: error | |
package: | |
name: Package for download | |
runs-on: ubuntu-22.04 | |
timeout-minutes: 10 | |
needs: build | |
steps: | |
- name: Download artifacts | |
uses: actions/download-artifact@v3 | |
- name: Combine artifacts | |
run: | | |
mkdir -p output | |
for dir in timecop_*.so; do | |
# Move/rename from timecop.so to timecop_PHPAPI.so | |
mv "${dir}/timecop.so" "output/${dir}" | |
done | |
cd output | |
sha256sum *.so > SHA256SUM | |
- name: Save artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: timecop | |
path: output/* | |
if-no-files-found: error |