Redesign calendar frontend #121
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: Unit Tests | |
on: | |
pull_request: | |
paths: | |
- '**.php' | |
- '*.json' | |
- '*.xml.dist' | |
push: | |
paths: | |
- '**.php' | |
- '*.json' | |
- '*.xml.dist' | |
branches: | |
- master | |
jobs: | |
phpcs: | |
name: PHP CodeSniffer | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Set up PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: '7.4' | |
coverage: none | |
tools: composer, cs2pr | |
- name: Install Composer dependencies | |
run: | | |
composer install --prefer-dist --no-suggest --no-progress --no-ansi --no-interaction | |
- name: Run PHPCS | |
run: | | |
vendor/bin/phpcs -q --report=checkstyle src | cs2pr | |
unit-php: | |
name: PHP Unit Tests | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Cache node modules | |
uses: actions/cache@26968a09c0ea4f3e233fdddbafd1166051a095f6 # v2.1.4 | |
env: | |
cache-name: cache-node-modules | |
with: | |
# npm cache files are stored in `~/.npm` on Linux/macOS | |
path: ~/.npm | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-build-${{ env.cache-name }}- | |
${{ runner.os }}-build- | |
${{ runner.os }}- | |
- name: Use Node.js 14.x | |
uses: actions/setup-node@v1 | |
with: | |
node-version: 14.x | |
- name: Npm install and build | |
run: | | |
npm ci | |
npm run build | |
- name: composer install | |
run: | | |
composer install | |
- name: Install WordPress | |
run: | | |
chmod -R 767 ./ # TODO: Possibly integrate in wp-env | |
npm run wp-env start | |
- name: Run unit tests | |
run: npm run test:unit-php | |
if: ${{ success() || failure() }} |