Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
18 changes: 2 additions & 16 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,16 +1,2 @@
*.php diff=php

/.github export-ignore
/bin export-ignore
/scripts export-ignore
/tests export-ignore

/.gitattributes export-ignore
/.gitignore export-ignore
/.php-cs-fixer.dist.php export-ignore
/.phpactor.json export-ignore
/.release-please-manifest.json export-ignore
/.stats.yml export-ignore
/phpstan.dist.neon export-ignore
/phpunit.xml.dist export-ignore
/release-please-config.json export-ignore
# This allows generated code to be indexed correctly
*.php linguist-generated=false
65 changes: 20 additions & 45 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,54 +1,29 @@
# Maintained in moderation-api/sdk-generator (custom/php). Edits here are overwritten.
name: CI
on:
push:
branches:
- '**'
- '!integrated/**'
- '!stl-preview-head/**'
- '!stl-preview-base/**'
- '!generated'
- '!codegen/**'
- 'codegen/stl/**'
branches: [main]
pull_request:
branches-ignore:
- 'stl-preview-head/**'
- 'stl-preview-base/**'

jobs:
lint:
timeout-minutes: 10
name: lint
runs-on: ${{ startsWith(github.repository, 'stainless-sdks/') && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork

steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- name: Set up PHP
uses: shivammathur/setup-php@accd6127cb78bee3e8082180cb391013d204ef9f # 2.37.0
with:
php-version: '8.3'
permissions:
contents: read

- name: Run Bootstrap
run: ./scripts/bootstrap

- name: Run lints
run: ./scripts/lint
test:
timeout-minutes: 10
name: test
runs-on: ${{ startsWith(github.repository, 'stainless-sdks/') && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- name: Set up PHP
uses: shivammathur/setup-php@accd6127cb78bee3e8082180cb391013d204ef9f # 2.37.0
- uses: shivammathur/setup-php@v2
with:
php-version: '8.3'

- name: Run bootstrap
run: ./scripts/bootstrap

- name: Run tests
run: ./scripts/test
php-version: "8.2"
- run: composer install --no-interaction --no-progress
- name: Static analysis
run: |
set -o pipefail
if ! vendor/bin/phpstan analyse --level=5 --memory-limit=2g --no-progress --error-format=raw > phpstan.txt 2>&1; then
head -n 40 phpstan.txt | sed 's/^/::error title=phpstan::/'
exit 1
fi
- name: Load the package
run: |
php -r 'require "vendor/autoload.php"; foreach (["ModerationApi\\ModerationApi", "ModerationApi\\WebhookSignature"] as $c) { if (!class_exists($c)) { fwrite(STDERR, "missing $c\n"); exit(1); } }'
16 changes: 8 additions & 8 deletions .github/workflows/publish-packagist.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
# Maintained in moderation-api/sdk-generator (custom/php). Edits here are overwritten.
# Packagist reads the version from the release tag.
name: Publish Packagist
on:
workflow_dispatch:

release:
types: [published]
workflow_dispatch:

permissions:
contents: read

jobs:
publish:
name: publish
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- name: Publish to Packagist
- name: Tell Packagist to update
run: |-
curl --fail-with-body -X POST -H 'Content-Type: application/json' "https://packagist.org/api/update-package?username=${PACKAGIST_USERNAME}&apiToken=${PACKAGIST_SAFE_KEY}" -d '{"repository":"https://github.com/moderation-api/sdk-php"}'
env:
PACKAGIST_USERNAME: ${{ secrets.MODERATION_API_PACKAGIST_USERNAME || secrets.PACKAGIST_USERNAME }}
PACKAGIST_SAFE_KEY: ${{ secrets.MODERATION_API_PACKAGIST_SAFE_KEY || secrets.PACKAGIST_SAFE_KEY }}
PACKAGIST_SAFE_KEY: ${{ secrets.MODERATION_API_PACKAGIST_SAFE_KEY || secrets.PACKAGIST_SAFE_KEY }}
22 changes: 0 additions & 22 deletions .github/workflows/release-doctor.yml

This file was deleted.

21 changes: 8 additions & 13 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
docs/
.idea/
.php-cs-fixer.cache
.php-cs-fixer.php
.phpunit.cache
phpunit.xml
playground/
*.swo
*.swp
vendor/

# do not edit! excludes generated files used internally
.artifacts/
composer.lock
vendor
.DS_Store
.DS_Store
**/.speakeasy/temp/
**/.speakeasy/logs/
.env
.env.local
19 changes: 0 additions & 19 deletions .php-cs-fixer.dist.php

This file was deleted.

6 changes: 0 additions & 6 deletions .phpactor.json

This file was deleted.

3 changes: 0 additions & 3 deletions .release-please-manifest.json

This file was deleted.

Loading
Loading