Skip to content

Fix the Github event name ref #12

Fix the Github event name ref

Fix the Github event name ref #12

Workflow file for this run

name: Run Tests
on:
workflow_dispatch:
push:
branches: [main]
pull_request_target:
types: [labeled]
branches: [main]
jobs:
test:
name: PHP ${{ matrix.php }}, Laravel ${{ matrix.laravel }}
runs-on: ubuntu-latest
if: contains(github.event.pull_request.labels.*.name, 'safe to test') || ((github.event_name == "push" || github.event_name == "workflow_dispatch") && github.ref_name == "main")

Check failure on line 15 in .github/workflows/test.yml

View workflow run for this annotation

GitHub Actions / Run Tests

Invalid workflow file

The workflow is not valid. .github/workflows/test.yml (Line: 15, Col: 9): Unexpected symbol: '"push"'. Located at position 93 within expression: contains(github.event.pull_request.labels.*.name, 'safe to test') || ((github.event_name == "push" || github.event_name == "workflow_dispatch") && github.ref_name == "main")
strategy:
max-parallel: 1
matrix:
php: [7.4, 8.0, 8.1, 8.2, 8.3]
laravel: [8.*, 9.*, 10.*, 11.*]
exclude:
- php: 7.4
laravel: 9.*
- php: 8.2
laravel: 8.*
- php: 8.2
laravel: 9.*
services:
stripemock:
image: stripe/stripe-mock:v0.141.0
ports:
- 12111
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: posix, dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick
coverage: none
- name: Install dependencies
run: |
composer config "http-basic.nova.laravel.com" "${{ secrets.NOVA_USERNAME }}" "${{ secrets.NOVA_LICENSE_KEY }}"
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" "phpunit/phpunit:${{ matrix.phpunit }}" --no-interaction --no-update
composer update --prefer-dist --no-interaction --no-progress --no-suggest
- name: Copy .env.example to .env
run: cp .env.testing.example .env.testing
- name: Run PHP tests
run: vendor/bin/phpunit
env:
STRIPE_TEST_SECRET: "${{ secrets.STRIPE_SECRET }}"
STRIPE_API_BASE: "127.0.0.1:${{ job.services.stripemock.ports[12111] }}"