Skip to content

Ensure "Amount Off" discounts are applied once per cart #678

Ensure "Amount Off" discounts are applied once per cart

Ensure "Amount Off" discounts are applied once per cart #678

Workflow file for this run

name: Test Suite
on:
push:
pull_request:
jobs:
php_tests:
if: "!contains(github.event.head_commit.message, 'changelog')"
runs-on: ${{ matrix.os }}
strategy:
matrix:
php: [8.3, 8.4, 8.5]
laravel: [12.*]
stability: [prefer-lowest, prefer-stable]
os: [ubuntu-latest]
name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }}
steps:
- name: Checkout code
uses: actions/checkout@v1
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v46
with:
files: |
config
lang
routes
src
tests
composer.json
phpunit.xml.dist
.github/workflows/tests.yaml
**.php
- name: Determine whether tests should run
id: should-run-tests
if: steps.changed-files.outputs.any_modified == 'true' || github.event_name == 'schedule'
run: |
echo "result=true" >> $GITHUB_OUTPUT
echo "result=true" >> $env:GITHUB_OUTPUT
- name: Get changed files (Payments)
id: changed-files-payments
uses: tj-actions/changed-files@v46
with:
files: |
.github/workflows/tests.yaml
src/Payments
src/Http/Controllers/Payments
tests/Feature/Payments
composer.json
- name: Determine whether payment tests should run
id: should-run-payment-tests
if: steps.changed-files-payments.outputs.any_modified == 'true' || github.event_name == 'schedule'
run: |
echo "result=true" >> $GITHUB_OUTPUT
echo "result=true" >> $env:GITHUB_OUTPUT
- name: Setup PHP
uses: shivammathur/setup-php@v2
if: steps.should-run-tests.outputs.result == 'true'
with:
php-version: ${{ matrix.php }}
extensions: fileinfo, exif, gd, pdo, sqlite, pdo_sqlite, intl
- name: Install dependencies
if: steps.should-run-tests.outputs.result == 'true'
run: |
composer require "illuminate/contracts:${{ matrix.laravel }}" --no-interaction --no-update
composer update --${{ matrix.stability }} --prefer-dist --no-interaction --no-suggest
- name: Execute tests
if: steps.should-run-tests.outputs.result == 'true'
run: vendor/bin/phpunit --exclude-group=payments
- name: Execute tests (Payments)
run: vendor/bin/phpunit --group=payments
if: steps.should-run-tests.outputs.result == 'true'
&& steps.should-run-payment-tests.outputs.result == 'true'
&& matrix.php == 8.5 && matrix.laravel == '12.*'
&& matrix.stability == 'prefer-stable'
env:
STRIPE_KEY: ${{ secrets.STRIPE_KEY }}
STRIPE_SECRET: ${{ secrets.STRIPE_SECRET }}
MOLLIE_KEY: ${{ secrets.MOLLIE_KEY }}
MOLLIE_PROFILE: ${{ secrets.MOLLIE_PROFILE }}