Skip to content

Execute agent with phpt tests delivered with PHP source code #483

Execute agent with phpt tests delivered with PHP source code

Execute agent with phpt tests delivered with PHP source code #483

Workflow file for this run

name: Execute agent with phpt tests delivered with PHP source code
on:
workflow_dispatch:
schedule:
- cron: '0 12 * * *'
permissions:
contents: read
jobs:
build:
uses: ./.github/workflows/build.yml
run-phpt-tests:
runs-on: ubuntu-latest
needs:
- build
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
php-version:
- "7.2"
- "7.3"
- "7.4"
- "8.0"
- "8.1"
- "8.2"
- "8.3"
steps:
# - uses: actions/checkout@v4
# - name: Fetch and extract latest release of apm-agent-php
# run: |
# wget https://github.com/elastic/apm-agent-php/releases/latest/download/apm-agent-php-linux-x86-64.tar -O /tmp/apm-agent-php-linux-x86-64.tar
# mkdir -p agent/native/_build/linux-x86-64-release/ext/
# cd agent/native/_build/linux-x86-64-release/ext/
# tar --wildcards --strip-components 5 -xf /tmp/apm-agent-php-linux-x86-64.tar ./opt/elastic/apm-agent-php/extensions/elastic_apm*
# cd -
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: package-parts-linux-x86-64
path: |
agent/native/_build/linux-x86-64-release/ext/
agent/native/_build/linux-x86-64-release/loader/code/
- name: Run phpt tests from PHP source code
continue-on-error: true
run: |
VERSION=${{ matrix.php-version }}
VERSION_SHORT=${VERSION//./}
cd agent/extension_phpt_test
docker compose build elasticsearch apm-server phpt_${VERSION_SHORT}
docker compose up -d elasticsearch apm-server
docker compose run phpt_${VERSION_SHORT}
docker compose stop
# exit 0
- if: success() || failure()
name: Change results ownership
continue-on-error: true
run: |
sudo chmod -R 777 agent/extension_phpt_test/results
sudo chown -R $(id -u):$(id -g) agent/extension_phpt_test/results
- if: success() || failure()
uses: actions/upload-artifact@v4
continue-on-error: true
with:
name: phpt-test-results-${{ matrix.php-version }}
path: agent/extension_phpt_test/results
if-no-files-found: error
- if: success() || failure()
name: Test summary
continue-on-error: true
run:
cat agent/extension_phpt_test/results/${{ matrix.php-version }}/*tests-result.md >> $GITHUB_STEP_SUMMARY