woocommerce/.github/workflows/pr-code-coverage.yml

65 lines
1.6 KiB
YAML
Raw Normal View History

name: Run code coverage on PR
on:
2022-05-17 19:29:16 +00:00
pull_request:
workflow_dispatch:
2021-10-12 13:33:04 +00:00
defaults:
run:
shell: bash
2022-04-21 16:45:12 +00:00
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
name: Code coverage (PHP 7.4, WP Latest)
timeout-minutes: 30
runs-on: ubuntu-20.04
services:
database:
image: mysql:5.6
env:
MYSQL_ROOT_PASSWORD: root
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=5
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 100
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 7.4
tools: composer
extensions: mysql
coverage: none
- name: Tool versions
run: |
php --version
composer --version
- uses: ./.github/actions/cache-deps
with:
workflow_name: pr-code-coverage
workflow_cache: ${{ secrets.WORKFLOW_CACHE }}
- name: Install and Build
uses: ./.github/actions/install-build
- name: Build Admin feature config
run: |
2022-04-06 03:27:37 +00:00
pnpm nx build:feature-config woocommerce
- name: Init DB and WP
run: pnpm nx install-unit-test-db woocommerce
- name: Run unit tests with code coverage. Allow to fail.
run: |
pnpm nx test-code-coverage woocommerce
exit 0
- name: Send code coverage to Codecov.
run: |
bash <(curl -s https://codecov.io/bash)