diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..89ae3b5 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,44 @@ +name: tests + +on: + push: + pull_request: + +jobs: + tests: + + runs-on: ubuntu-latest + + strategy: + matrix: + php: [7.4, 7.3, 7.2] + laravel: [7.*, 6.*, 5.8.*] + + name: P${{ matrix.php }} - L${{ matrix.laravel }} + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Cache dependencies + uses: actions/cache@v1 + with: + path: ~/.composer/cache/files + key: dependencies-laravel-${{ matrix.laravel }}-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }} + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + extensions: dom, curl, libxml, mbstring, zip + coverage: none + + - name: Install dependencies + run: composer install --no-scripts + + - name: Execute tests + run: vendor/bin/phpunit --verbose + env: + PWINTY_API_KEY: ${{secrets.PWINTY_API_KEY}} + PWINTY_MERCHANT_ID: ${{secrets.PWINTY_MERCHANT_ID}} + PWINTY_SKU: ${{secrets.PWINTY_SKU}}