Skip to content

Instantly share code, notes, and snippets.

@peterfox
Created November 23, 2022 00:35

Revisions

  1. peterfox created this gist Nov 23, 2022.
    35 changes: 35 additions & 0 deletions run-test.yml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,35 @@
    name: run-tests

    on:
    push:
    pull_request:
    branches: [ main ]

    env:
    APP_KEY: base64:eKPh6g5fsCHE9Upe5m++NHasEhJzFkqgUUhf59E4BkU=

    jobs:
    test:
    runs-on: ubuntu-latest

    steps:
    - name: Checkout code
    uses: actions/checkout@v3

    - name: Setup PHP
    uses: shivammathur/setup-php@v2
    with:
    php-version: 8.1
    extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, pdo_sqlite
    tools: composer:v2
    coverage: pcov

    - uses: ramsey/composer-install@v2

    - name: Execute tests
    run: php artisan test --coverage --coverage-clover storage/coverage/coverage.xml

    - uses: codecov/codecov-action@v3
    with:
    token: ${{ secrets.CODECOV_TOKEN }}
    files: ./storage/coverage/coverage.xml