From ab7384a9f090e71a735e64f04c5dd48bc0f0fa43 Mon Sep 17 00:00:00 2001 From: PodLaura <114921912+PodLaura@users.noreply.github.com> Date: Tue, 5 Mar 2024 16:31:59 +0000 Subject: [PATCH 1/4] Create and populate php.yml Just building for now, will update to run tests once this is up and running to give a baseline. --- .github/workflows/php.yml | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/php.yml diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml new file mode 100644 index 0000000..926b98b --- /dev/null +++ b/.github/workflows/php.yml @@ -0,0 +1,39 @@ +name: PHP Composer + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +permissions: + contents: read + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Validate composer.json and composer.lock + run: composer validate --strict + + - name: Cache Composer packages + id: composer-cache + uses: actions/cache@v3 + with: + path: vendor + key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} + restore-keys: | + ${{ runner.os }}-php- + + - name: Install dependencies + run: composer install --prefer-source --no-interaction + + # Add a test script to composer.json, for instance: "test": "vendor/bin/phpunit" + # Docs: https://getcomposer.org/doc/articles/scripts.md + + #- name: Run test suite + # run: composer run-script test From ac8c3942ab340f7b34b360a650e8b5751a813f1d Mon Sep 17 00:00:00 2001 From: PodLaura <114921912+PodLaura@users.noreply.github.com> Date: Wed, 6 Mar 2024 08:50:31 +0000 Subject: [PATCH 2/4] Update github action to use specific PHP version and mirror travis steps more closely --- .github/workflows/php.yml | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 926b98b..0de24b0 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -17,23 +17,13 @@ jobs: steps: - uses: actions/checkout@v3 - - name: Validate composer.json and composer.lock - run: composer validate --strict - - - name: Cache Composer packages - id: composer-cache - uses: actions/cache@v3 + - name: Setup PHP + uses: shivammathur/setup-php@v2 with: - path: vendor - key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} - restore-keys: | - ${{ runner.os }}-php- + php-version: '7.1' + + - name: Copy .env + run: cp .env.example .env - name: Install dependencies run: composer install --prefer-source --no-interaction - - # Add a test script to composer.json, for instance: "test": "vendor/bin/phpunit" - # Docs: https://getcomposer.org/doc/articles/scripts.md - - #- name: Run test suite - # run: composer run-script test From 0483729e55d585372783dfa27daf463221a7a4d3 Mon Sep 17 00:00:00 2001 From: PodLaura <114921912+PodLaura@users.noreply.github.com> Date: Wed, 6 Mar 2024 08:56:17 +0000 Subject: [PATCH 3/4] Add in test runner stage --- .github/workflows/php.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 0de24b0..2e565fb 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -27,3 +27,6 @@ jobs: - name: Install dependencies run: composer install --prefer-source --no-interaction + + - name: Run tests + run: vendor/bin/phpunit --coverage-clover build/logs/clover.xml From a21889eb6a001d44dcd1ebb052fc8411e906c57b Mon Sep 17 00:00:00 2001 From: PodLaura <114921912+PodLaura@users.noreply.github.com> Date: Thu, 7 Mar 2024 15:33:27 +0000 Subject: [PATCH 4/4] Pass test stripe api key as a env to the test runner --- .github/workflows/php.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 2e565fb..4fc3504 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -29,4 +29,6 @@ jobs: run: composer install --prefer-source --no-interaction - name: Run tests + env: + STRIPE_KEY: ${{secrets.STRIPE_KEY}} run: vendor/bin/phpunit --coverage-clover build/logs/clover.xml