Skip to content

Commit

Permalink
Merge pull request #17 from corbado/16-improve-sdk
Browse files Browse the repository at this point in the history
improve sdk
  • Loading branch information
corbadoman authored Jan 14, 2024
2 parents 3cac77d + 6a320ac commit 9bd3983
Show file tree
Hide file tree
Showing 304 changed files with 33,121 additions and 3,239 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: tests

on:
push:
branches: '*'

concurrency:
group: ${{ github.ref }}
cancel-in-progress: true

jobs:
unittests:
uses: "./.github/workflows/ci_unittests.yml"
secrets: inherit

integrationtests:
uses: "./.github/workflows/ci_integrationtests.yml"
secrets: inherit

analyze:
uses: "./.github/workflows/ci_analyze.yml"
secrets: inherit

cs-check:
uses: "./.github/workflows/ci_cs_check.yml"
secrets: inherit
25 changes: 9 additions & 16 deletions .github/workflows/build.yml → .github/workflows/ci_analyze.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,30 @@
name: Build workflow
name: analyze

on:
push:
branches: '*'
pull_request:
branches: '*'
workflow_call:

jobs:
build:
name: Build
analyze:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php:
- '8.0'
- '8.1'
- '8.2'
- '8.3'

steps:
- name: Set up PHP
uses: shivammathur/setup-php@v2
- uses: actions/checkout@v3

- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}

- name: Check PHP version
run: php -v

- name: Checkout code
uses: actions/checkout@v3

- name: Validate composer.json and composer.lock
run: composer validate --strict

Expand All @@ -45,7 +41,4 @@ jobs:
run: composer install --prefer-dist --no-progress

- name: Run analyze
run: composer analyze

- name: Run tests
run: composer test
run: composer analyze
44 changes: 44 additions & 0 deletions .github/workflows/ci_cs_check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: cs-check

on:
workflow_call:

jobs:
cs-check:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php:
- '8.0'
- '8.1'
- '8.2'
- '8.3'

steps:
- uses: actions/checkout@v3

- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}

- name: Check PHP version
run: php -v

- 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-${{ matrix.php }}-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-${{ matrix.php }}-
- name: Install dependencies
run: composer install --prefer-dist --no-progress

- name: Run cs check
run: composer cs-check
48 changes: 48 additions & 0 deletions .github/workflows/ci_integrationtests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: integrationtests

on:
workflow_call:

jobs:
integrationtests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php:
- '8.0'
- '8.1'
- '8.2'
- '8.3'

steps:
- uses: actions/checkout@v3

- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}

- name: Check PHP version
run: php -v

- 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-${{ matrix.php }}-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-${{ matrix.php }}-
- name: Install dependencies
run: composer install --prefer-dist --no-progress

- name: Run integration tests
env:
CORBADO_BACKEND_API: ${{ secrets.CORBADO_BACKEND_API }}
CORBADO_PROJECT_ID: ${{ secrets.CORBADO_PROJECT_ID }}
CORBADO_API_SECRET: ${{ secrets.CORBADO_API_SECRET }}
run: composer integrationtests
44 changes: 44 additions & 0 deletions .github/workflows/ci_unittests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: unittests

on:
workflow_call:

jobs:
unittests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php:
- '8.0'
- '8.1'
- '8.2'
- '8.3'

steps:
- uses: actions/checkout@v3

- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}

- name: Check PHP version
run: php -v

- 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-${{ matrix.php }}-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-${{ matrix.php }}-
- name: Install dependencies
run: composer install --prefer-dist --no-progress

- name: Run unit tests
run: composer unittests
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
.idea/
vendor/
scripts/.gen
composer.lock
.phpunit.result.cache
.DS_Store
.php-cs-fixer.cache
10 changes: 10 additions & 0 deletions .php-cs-fixer.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

$finder = PhpCsFixer\Finder::create()
->in(__DIR__)
->notPath('src/Generated');

$config = new PhpCsFixer\Config();
$config->setFinder($finder);

return $config;
Loading

0 comments on commit 9bd3983

Please sign in to comment.