Skip to content

Build

Build #167

Workflow file for this run

name: Build
on:
schedule:
- cron: '0 2 * * 0' # Weekly on Sundays at 02:00
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build:
services:
mysql:
image: mysql:5.7
env:
MYSQL_ALLOW_EMPTY_PASSWORD: false
MYSQL_ROOT_PASSWORD: password
MYSQL_DATABASE: wordpress
ports:
- 3306
options: --tmpfs /tmp:rw --tmpfs /var/lib/mysql:rw --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
runs-on: ubuntu-latest
strategy:
matrix:
php-version: [ '7.4', '8.0', '8.1' ]
steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
- name: Checkout code
uses: actions/checkout@v2
with:
path: multisafepay
- name: Get latest release tag of WooCommerce
id: latestrelease
run: |
echo "::set-output name=releasetag::$(curl -s https://api.github.com/repos/woocommerce/woocommerce/releases/latest | jq '.tag_name' | sed 's/\"//g')"
- name: Download WooCommerce
uses: dsaltares/fetch-gh-release-asset@master
with:
repo: 'woocommerce/woocommerce'
version: 'tags/${{ steps.latestrelease.outputs.releasetag }}'
file: 'woocommerce.zip'
token: ${{ secrets.GITHUB_TOKEN }}
- name: Unzip WooCommerce
run: unzip woocommerce.zip
- name: Install composer for plugin
working-directory: multisafepay
run: composer install --dev
- name: Setup test environment
working-directory: multisafepay
shell: bash
run: bin/install-wp-tests.sh woocommerce_test root password 127.0.0.1:${{ job.services.mysql.ports['3306'] }}
- name: Run PHPUnit
working-directory: multisafepay
run: php vendor/bin/phpunit --coverage-clover=coverage.xml
- name: upload code coverage
working-directory: multisafepay
run: bash <(curl -s https://codecov.io/bash) -t ${{ secrets.CODECOV_TOKEN }}