Skip to content
Open
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,3 @@ indent_size = 2

[*.php]
indent_size = 4

[Makefile]
indent_style = tab
22 changes: 22 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@
src/Resources/*.php linguist-generated
src/Routes/*.php linguist-generated
src/SeamClient.php linguist-generated

# Keep development files out of the published package.
# GitHub builds the archives Composer downloads as dist with git archive,
# which honours these rules.
/.devcontainer export-ignore
/.editorconfig export-ignore
/.env.example export-ignore
/.gitattributes export-ignore
/.github export-ignore
/.gitignore export-ignore
/.npmrc export-ignore
/.prettierignore export-ignore
/.prettierrc.json export-ignore
/.releaserc.json export-ignore
/codegen export-ignore
/eslint.config.ts export-ignore
/package-lock.json export-ignore
/package.json export-ignore
/phpunit.xml.dist export-ignore
/tests export-ignore
/tsconfig.json export-ignore
/version.ts export-ignore
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1 +1 @@
* @rchodava @andrii-balitskyi @seveibar
* @seamapi/sdk
46 changes: 46 additions & 0 deletions .github/actions/setup-node/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
name: Setup Node.js
description: Setup Node.js and install dependencies.

inputs:
node_version:
description: The Node.js version.
required: false
default: '24'
registry_url:
description: The Node.js package registry URL.
required: false
default: https://registry.npmjs.org
install_dependencies:
description: Install dependencies.
required: false
default: 'true'

runs:
using: composite
steps:
- name: Setup Node.js
uses: actions/setup-node@v7
if: inputs.install_dependencies == 'true'
with:
node-version: ${{ inputs.node_version }}
registry-url: ${{ inputs.registry_url }}
- name: Setup Node.js without cache
uses: actions/setup-node@v7
if: inputs.install_dependencies == 'false'
with:
node-version: ${{ inputs.node_version }}
registry-url: ${{ inputs.registry_url }}
- name: Install dependencies
if: inputs.install_dependencies == 'true'
shell: bash
run: npm ci --ignore-scripts
- name: Rebuild Node.js modules
shell: bash
run: npm rebuild
- name: Run postinstall script
shell: bash
run: npm run postinstall --if-present
- name: Run prepare script
shell: bash
run: npm run prepare --if-present
55 changes: 27 additions & 28 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
---
name: Setup
description: Setup Node.js and install dependencies.
description: Setup PHP and install dependencies.

inputs:
node_version:
description: The Node.js version.
required: false
default: '24'
registry_url:
description: The Node.js package registry URL.
php_version:
description: The PHP version.
required: false
default: https://registry.npmjs.org
default: '8.5'
install_dependencies:
description: Install dependencies.
required: false
Expand All @@ -18,28 +15,30 @@ inputs:
runs:
using: composite
steps:
- name: Setup Node.js
uses: actions/setup-node@v7
if: inputs.install_dependencies == 'true'
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
node-version: ${{ inputs.node_version }}
registry-url: ${{ inputs.registry_url }}
- name: Setup Node.js without cache
uses: actions/setup-node@v7
if: inputs.install_dependencies == 'false'
with:
node-version: ${{ inputs.node_version }}
registry-url: ${{ inputs.registry_url }}
- name: Install dependencies
php-version: ${{ inputs.php_version }}
tools: composer:v2
coverage: none
- name: Check lockfile
if: inputs.install_dependencies == 'true'
shell: bash
run: npm ci --ignore-scripts
- name: Rebuild Node.js modules
shell: bash
run: npm rebuild
- name: Run postinstall script
run: composer validate --strict
- name: Get Composer cache directory
id: composer_cache
if: inputs.install_dependencies == 'true'
shell: bash
run: npm run postinstall --if-present
- name: Run prepare script
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Setup Composer cache
uses: actions/cache@v4
if: inputs.install_dependencies == 'true'
with:
key: composer-${{ inputs.php_version }}-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('composer.lock') }}
restore-keys: |
composer-${{ inputs.php_version }}-${{ runner.os }}-${{ runner.arch }}-
path: ${{ steps.composer_cache.outputs.dir }}
- name: Install dependencies
if: inputs.install_dependencies == 'true'
shell: bash
run: npm run prepare --if-present
run: composer install --no-interaction --no-progress
36 changes: 36 additions & 0 deletions .github/workflows/_build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
name: _build

on:
workflow_call:
inputs:
php_version:
description: The PHP version.
type: string
required: false
default: '8.5'
outputs:
artifact_name:
description: The artifact name.
value: build-${{ github.sha }}

jobs:
build:
name: Package
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Setup
uses: ./.github/actions/setup
with:
php_version: ${{ inputs.php_version }}
- name: Build
run: composer build
- name: Upload artifact
uses: actions/upload-artifact@v7
with:
name: build-${{ github.sha }}
if-no-files-found: error
path: pkg/
124 changes: 124 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
---
name: Check

on:
push:
branches:
- main
pull_request:
branches:
- '**'

jobs:
test:
name: Test (PHP ${{ matrix.php }} on ${{ matrix.os_name }})
runs-on: ${{ matrix.os }}
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
php:
- '8.0'
- '8.5'
include:
- os: ubuntu-latest
os_name: Linux
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Setup
uses: ./.github/actions/setup
with:
php_version: ${{ matrix.php }}
- name: Setup Node.js
uses: ./.github/actions/setup-node
- name: Test
run: composer test
lint:
name: Lint (PHP ${{ matrix.php }})
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
php:
- '8.0'
- '8.5'
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Setup
uses: ./.github/actions/setup
with:
php_version: ${{ matrix.php }}
- name: Setup Node.js
uses: ./.github/actions/setup-node
- name: Lint
run: composer lint
- name: Lint with ESLint and Prettier
run: npm run lint
build:
name: Build
uses: ./.github/workflows/_build.yml
install:
name: Install (PHP ${{ matrix.php }} on ${{ matrix.os_name }})
runs-on: ${{ matrix.os }}
timeout-minutes: 30
needs: build
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
php:
- '8.0'
- '8.5'
include:
- os: ubuntu-latest
os_name: Linux
steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
tools: composer:v2
coverage: none
- name: Download artifact
uses: actions/download-artifact@v8
with:
name: ${{ needs.build.outputs.artifact_name }}
path: pkg/
- name: Extract package
run: unzip -q pkg/seam.zip -d package
- name: Create composer.json
uses: DamianReeves/write-file-action@v1.3
with:
write-mode: overwrite
path: composer.json
contents: |
{
"repositories": [
{
"type": "path",
"url": "./package",
"options": { "symlink": false }
}
],
"require": { "seamapi/seam": "*" },
"minimum-stability": "dev"
}
- name: Create main.php
uses: DamianReeves/write-file-action@v1.3
with:
write-mode: overwrite
path: main.php
contents: |
<?php
require __DIR__ . '/vendor/autoload.php';
new Seam\SeamClient('seam_apikey1_token');
- name: Install
run: composer install --no-interaction --no-progress
- name: Run
run: php main.php
41 changes: 41 additions & 0 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
name: Format

on:
push:
branches-ignore:
- main
workflow_dispatch: {}

jobs:
commit:
name: Format code
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout
uses: actions/checkout@v7
with:
ref: ${{ github.head_ref }}
token: ${{ secrets.GH_TOKEN }}
- name: Import GPG key
uses: crazy-max/ghaction-import-gpg@v7
with:
git_user_signingkey: true
git_commit_gpgsign: true
git_committer_name: ${{ secrets.GIT_USER_NAME }}
git_committer_email: ${{ secrets.GIT_USER_EMAIL }}
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}
- name: Setup Node.js
uses: ./.github/actions/setup-node
- name: Format with Prettier
run: npm run format
- name: Commit
uses: stefanzweifel/git-auto-commit-action@v7
if: always()
with:
commit_message: 'ci: Format code'
commit_user_name: ${{ secrets.GIT_USER_NAME }}
commit_user_email: ${{ secrets.GIT_USER_EMAIL }}
commit_author: ${{ secrets.GIT_USER_NAME }} <${{ secrets.GIT_USER_EMAIL }}>
4 changes: 2 additions & 2 deletions .github/workflows/generate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ jobs:
git_committer_email: ${{ secrets.GIT_USER_EMAIL }}
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}
- name: Setup
uses: ./.github/actions/setup
- name: Setup Node.js
uses: ./.github/actions/setup-node
with:
install_dependencies: 'false'
- name: Normalize package-lock.json
Expand Down
Loading
Loading