fix: ensure statistics widget returns string value (#17) #234
This file contains hidden or 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: Core CI Pipeline | |
on: [ push, pull_request, workflow_dispatch ] | |
jobs: | |
build-assets: | |
permissions: | |
contents: write | |
uses: tastyigniter/workflows/.github/workflows/build-assets.yml@main | |
secrets: | |
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }} | |
php-lint: | |
needs: build-assets | |
if: ${{ always() && needs.build-assets.result == 'success' }} | |
name: PHP Linting (Pint) | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: '8.3' | |
tools: composer:v2 | |
coverage: none | |
- name: Set composer version to avoid conflicts | |
if: github.head_ref != 'master' && github.head_ref != 'main' && github.head_ref != '4.x' | |
run: composer config version 4.0.x-dev | |
- name: Install composer dependencies | |
run: composer update --no-interaction --no-progress | |
- name: Remove composer version after use | |
if: github.head_ref != 'master' && github.head_ref != 'main' && github.head_ref != '4.x' | |
run: composer config --unset version | |
- name: Run Laravel Pint | |
run: composer format | |
- name: Commit changes | |
uses: stefanzweifel/git-auto-commit-action@v5 | |
with: | |
commit_message: PHP Linting (Pint) - Fix styling | |
file_pattern: '*.php' | |
php-tests: | |
name: 'PHP Tests' | |
needs: php-lint | |
if: ${{ always() && needs.php-lint.result == 'success' }} | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
php: [ '8.3', '8.4' ] | |
services: | |
mysql: | |
image: mysql:latest | |
env: | |
MYSQL_ALLOW_EMPTY_PASSWORD: false | |
MYSQL_ROOT_PASSWORD: root | |
MYSQL_DATABASE: testbench | |
ports: | |
- 3306/tcp | |
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 | |
env: | |
DB_DATABASE: testbench | |
DB_USERNAME: root | |
DB_PASSWORD: root | |
steps: | |
- name: Checkout changes | |
uses: actions/checkout@v4 | |
- name: Create MySQL Database | |
run: | | |
sudo service mysql start | |
mysql -u${{ env.DB_USERNAME }} -p${{ env.DB_PASSWORD }} -e "CREATE DATABASE ${{ env.DB_DATABASE }};" | |
- name: Setup PHP ${{ matrix.php-version }} | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php-version }} | |
extensions: dom, curl, xml, mbstring, zip, pdo, sqlite, bcmath, soap, intl, gd | |
tools: composer:v2 | |
coverage: none | |
- name: Set composer version to avoid conflicts | |
if: github.head_ref != 'master' && github.head_ref != '4.x' | |
run: composer config version 4.0.x-dev | |
- name: Install composer dependencies | |
run: composer update --no-interaction --no-progress | |
- name: Remove composer version after use | |
if: github.head_ref != 'master' && github.head_ref != '4.x' | |
run: composer config --unset version | |
- name: Run test suite | |
run: composer test |