From d13503aae7cbfe855ea7e4d69e1ce923b94e7809 Mon Sep 17 00:00:00 2001 From: Richard Marmorstein <52928443+richardm-stripe@users.noreply.github.com> Date: Mon, 20 Mar 2023 11:38:25 -0700 Subject: [PATCH] Change github workflow (#1460) * Change github workflow * Update Makefile * Update tests/Stripe/GeneratedExamplesTest.php * Update Makefile * Yaml sucks --------- Co-authored-by: pakrym-stripe <99349468+pakrym-stripe@users.noreply.github.com> --- .github/workflows/ci.yml | 20 +++++++++++++++++--- Makefile | 4 ++++ 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cd5eea158..3a44bfbda 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -126,13 +126,12 @@ jobs: - name: Install dependencies run: composer install --prefer-dist --no-progress - - name: Start stripe-mock - run: docker pull stripe/stripe-mock && docker run -d -p 12111-12112:12111-12112 stripe/stripe-mock && sleep 5 + - uses: stripe/openapi/actions/stripe-mock@master - name: Run test suite run: | php --version - ./build.php $env:AUTOLOAD + make ci-test - name: Coveralls run: vendor/bin/php-coveralls -v --coverage_clover='clover.xml' --json_path='coveralls-upload.json' @@ -141,3 +140,18 @@ jobs: COVERALLS_RUN_LOCALLY: 1 COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} COVERALLS_FLAG_NAME: php-${{ matrix.php-version }}-${{ matrix.env }} + + publish: + # Doesn't actually publish. The publish happens via a packagist webhook configured in the Github UI. But we still display a message here + name: Publish + if: >- + (github.event_name == 'workflow_dispatch' || github.event_name == 'push') && + startsWith(github.ref, 'refs/tags/v') && + endsWith(github.actor, '-stripe') + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: stripe/openapi/actions/notify-release@master + if: always() + with: + bot_token: ${{ secrets.SLACK_BOT_TOKEN }} diff --git a/Makefile b/Makefile index 68c1586dd..4702fcb47 100644 --- a/Makefile +++ b/Makefile @@ -11,6 +11,10 @@ test: vendor vendor/bin/phpunit .PHONY: test +ci-test: vendor + ./build.php $$AUTOLOAD +.PHONY: ci-test + fmt: vendor PHP_CS_FIXER_IGNORE_ENV=true vendor/bin/php-cs-fixer fix -v --using-cache=no .PHONY: fmt