Bump actions/download-artifact from 3 to 4.1.7 in /.github/workflows #243
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 and test" | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
php-version: ["7.1", "8.2"] | |
# extension: ["pdo_odbc", "ibm_db2"] | |
# We can not test "IBM DB2 for i" currently. | |
extension: ["ibm_db2"] | |
dependencies: ["lowest", "highest"] | |
services: | |
# Find a way to use "IBM DB2 for i". | |
# @see https://github.com/php/pecl-database-ibm_db2/issues/46. | |
ibm_db2: | |
image: "icr.io/db2_community/db2:11.5.8.0" | |
env: | |
DB2INST1_PASSWORD: "Doctrine2018" | |
LICENSE: "accept" | |
DBNAME: "doctrine" | |
options: "--privileged=true" | |
ports: | |
- "50000:50000" | |
volumes: | |
- "/tmp/database:/database" | |
steps: | |
- name: "Perform healthcheck from the outside" | |
run: "docker logs -f ${{ job.services.ibm_db2.id }} | sed '/(*) Setup has completed./ q'" | |
- name: "Create temporary tablespace" | |
run: "docker exec ${{ job.services.ibm_db2.id }} su - db2inst1 -c 'db2 -t CONNECT TO doctrine; db2 -t CREATE USER TEMPORARY TABLESPACE doctrine_tbsp PAGESIZE 4 K;'" | |
- name: "Checkout" | |
uses: "actions/checkout@v3" | |
with: | |
fetch-depth: 2 | |
- name: "Install IBM i Access ODBC driver" | |
if: "${{ matrix.extension == 'pdo_odbc' }}" | |
working-directory: /tmp | |
run: | | |
curl "https://public.dhe.ibm.com/software/ibmi/products/odbc/debs/dists/1.1.0/ibmi-acs-1.1.0.list" | sudo tee /etc/apt/sources.list.d/ibmi-acs-1.1.0.list | |
sudo apt-get update | |
sudo apt-get install -qq --yes --no-install-recommends ibm-iaccess | |
- name: "Install PHP" | |
if: "${{ matrix.extension == 'pdo_odbc' }}" | |
uses: "shivammathur/setup-php@v2" | |
with: | |
php-version: "${{ matrix.php-version }}" | |
extensions: "pdo_odbc" | |
coverage: "pcov" | |
ini-values: "zend.assertions=1, ibm_db2.instance_name=db2inst1" | |
env: | |
PDO_ODBC_CONFIGURE_OPTS: "--with-pdo-odbc=unixODBC,/usr" | |
- name: "Install IBM CLI driver" | |
if: "${{ matrix.extension == 'ibm_db2' }}" | |
working-directory: /tmp | |
run: | | |
wget "https://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/linuxx64_odbc_cli.tar.gz" | |
tar xf linuxx64_odbc_cli.tar.gz | |
rm linuxx64_odbc_cli.tar.gz | |
- name: "Configure cataloged database with 'db2cli.ini'" | |
if: "${{ matrix.extension == 'ibm_db2' }}" | |
run: "cp ./tests/db2cli.ini /tmp/clidriver/cfg/db2cli.ini" | |
- name: "Determine version for ibm_db2" | |
id: ibm_db2_ver | |
if: "${{ matrix.extension == 'ibm_db2' }}" | |
run: | | |
if [[ "${{ matrix.php-version }}" == 7.1* ]] || [[ "${{ matrix.php-version }}" == 7.2* ]]; then | |
echo "ibm_db2_ver=2.1.3" >> "$GITHUB_OUTPUT" | |
else | |
echo "ibm_db2_ver=2.1.7" >> "$GITHUB_OUTPUT" | |
fi; | |
- name: "Install PHP" | |
if: "${{ matrix.extension == 'ibm_db2' }}" | |
uses: "shivammathur/setup-php@v2" | |
with: | |
php-version: "${{ matrix.php-version }}" | |
extensions: ":pdo_odbc, ibm_db2-${{ steps.ibm_db2_ver.outputs.ibm_db2_ver }}" | |
coverage: "pcov" | |
ini-values: "zend.assertions=1, ibm_db2.instance_name=db2inst1" | |
env: | |
IBM_DB2_CONFIGURE_OPTS: "--with-IBM_DB2=/tmp/clidriver" | |
- name: "Install dependencies with Composer (${{ matrix.dependencies }})" | |
uses: "ramsey/composer-install@v2" | |
with: | |
dependency-versions: "${{ matrix.dependencies }}" | |
- name: "Run PHPUnit (${{ matrix.extension }})" | |
run: "vendor/bin/phpunit --coverage-clover=coverage.xml" | |
- name: "Upload coverage file" | |
uses: "actions/upload-artifact@v3" | |
with: | |
name: "${{ github.job }}-${{ matrix.php-version }}-${{ matrix.extension }}.coverage" | |
path: "coverage.xml" | |
upload_coverage: | |
name: "Upload coverage to Codecov" | |
runs-on: "ubuntu-22.04" | |
needs: | |
- "test" | |
steps: | |
- name: "Checkout" | |
uses: "actions/checkout@v3" | |
with: | |
fetch-depth: 2 | |
- name: "Download coverage files" | |
uses: "actions/[email protected]" | |
with: | |
path: "reports" | |
- name: "Upload to Codecov" | |
uses: "codecov/codecov-action@v3" | |
with: | |
directory: reports |