-
Notifications
You must be signed in to change notification settings - Fork 853
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add justfile, remove coveralls, and fix AUTOLOAD in CI #1801
Changes from 11 commits
b23abf5
c911b8a
d03a553
33d3426
9de906a
dc89cd1
a80cc09
31652eb
06fc80c
c03177d
1db293e
fd1eb0d
c558dde
e6cc3e2
b30f3bb
38080e7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,18 +37,14 @@ jobs: | |
|
||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
php-version: | ||
- "8.2" | ||
|
||
steps: | ||
- uses: extractions/setup-just@v2 | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php-version }} | ||
php-version: "8.2" | ||
|
||
- name: Get Composer Cache Directory | ||
id: composer-cache | ||
|
@@ -69,19 +65,17 @@ jobs: | |
run: composer install --prefer-dist --no-progress | ||
|
||
- name: Run phpstan | ||
run: make phpstan | ||
run: just lint | ||
|
||
tests: | ||
name: Tests | ||
|
||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
env: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this never worked as intended: |
||
- AUTOLOAD=0 | ||
- AUTOLOAD=1 | ||
autoload: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. because |
||
- "0" | ||
- "1" | ||
php-version: | ||
- "5.6" | ||
- "7.0" | ||
|
@@ -92,15 +86,16 @@ jobs: | |
- "8.0" | ||
- "8.1" | ||
- "8.2" | ||
name: Tests (php@${{ matrix.php-version }}, AUTOLOAD=${{ matrix.autoload }}) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This will show a nicer name now that we're not using the full |
||
|
||
steps: | ||
- uses: extractions/setup-just@v2 | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php-version }} | ||
coverage: xdebug | ||
|
||
- name: Get Composer Cache Directory | ||
id: composer-cache | ||
|
@@ -125,17 +120,10 @@ jobs: | |
- uses: stripe/openapi/actions/stripe-mock@master | ||
|
||
- name: Run test suite | ||
# --yes skips the confirmation dialogue for the CI test, which modifies files | ||
run: | | ||
php --version | ||
make ci-test | ||
|
||
- name: Coveralls | ||
if: matrix.php-version == '8.2' && matrix.env == 'AUTOLOAD=1' | ||
uses: coverallsapp/github-action@v2 | ||
with: | ||
files: clover.xml | ||
flag-name: php-${{ matrix.php-version }}-${{ matrix.env }} | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
just --yes ci-test ${{ matrix.autoload }} | ||
|
||
publish: | ||
# Doesn't actually publish. The publish happens via a packagist webhook configured in the Github UI. But we still display a message here | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
import? '../sdk-codegen/justfile' | ||
|
||
set quiet | ||
|
||
export PATH := "./vendor/bin:" + env_var('PATH') | ||
PHPDOCUMENTOR_VERSION := "v3.0.0" | ||
|
||
_default: | ||
just --list --unsorted | ||
|
||
# install vendored dependencies; only used locally | ||
[group('useful')] | ||
install: | ||
composer install | ||
|
||
[no-exit-message] | ||
[group('useful')] | ||
test *options: | ||
phpunit {{ options }} | ||
|
||
[group('CI')] | ||
[confirm("This will modify local files and is intended for use in CI; do you want to proceed?")] | ||
ci-test autoload: | ||
echo "running build.php with argument: {{ autoload }}" | ||
./build.php {{ autoload }} | ||
|
||
[group('useful')] | ||
format *options: | ||
PHP_CS_FIXER_IGNORE_ENV=1 php-cs-fixer fix -v --using-cache=no {{ options }} | ||
|
||
# for backwards compatibility; ideally removed later | ||
[private] | ||
alias codegen-format := format | ||
|
||
[group('CI')] | ||
format-check: (format "--dry-run") | ||
|
||
[group('CI')] | ||
lint *options: | ||
php -d memory_limit=512M vendor/bin/phpstan analyse lib tests {{options}} | ||
|
||
# for backwards compatibility; ideally removed later | ||
[private] | ||
alias phpstan := lint | ||
|
||
[group('misc')] | ||
phpstan-baseline: (lint "--generate-baseline") | ||
|
||
# called by tooling | ||
[private] | ||
update-version version: | ||
echo "{{ version }}" > VERSION | ||
perl -pi -e 's|VERSION = '\''[.\-\w\d]+'\''|VERSION = '\''{{ version }}'\''|' lib/Stripe.php | ||
|
||
[group('misc')] | ||
phpdoc: | ||
#!/usr/bin/env bash | ||
set -euo pipefail | ||
|
||
if [ ! -f vendor/bin/phpdoc ]; then | ||
curl -sfL https://github.com/phpDocumentor/phpDocumentor/releases/download/{{ PHPDOCUMENTOR_VERSION }}/phpDocumentor.phar -o vendor/bin/phpdoc | ||
chmod +x vendor/bin/phpdoc | ||
fi | ||
|
||
phpdoc |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we're not running
phpstan
across multiple PHP versions, I just hardcoded the value we're using