Skip to content

Commit

Permalink
chore: Sync changes from the template
Browse files Browse the repository at this point in the history
  • Loading branch information
oprypkhantc authored and package-sync[bot] committed Apr 24, 2024
1 parent ece8095 commit 9e83413
Show file tree
Hide file tree
Showing 10 changed files with 181 additions and 155 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = false
trim_trailing_whitespace = false
28 changes: 14 additions & 14 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Release

on:
workflow_run:
workflows: ["Tests"]
workflows: ['Tests']
types:
- completed
branches:
Expand All @@ -18,17 +18,17 @@ jobs:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Create a release
uses: cycjimmy/semantic-release-action@v3
with:
extra_plugins: |
@semantic-release/changelog
@semantic-release/git
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Create a release
uses: cycjimmy/semantic-release-action@v3
with:
extra_plugins: |
@semantic-release/changelog
@semantic-release/git
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
4 changes: 1 addition & 3 deletions .github/workflows/template-sync.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
name: Template sync

on:
push:
branches: ['sync']
workflow_dispatch:
schedule:
- cron: '*/5 * * * *'
Expand All @@ -18,7 +16,7 @@ jobs:

- name: Sync from template
id: sync_from_template
uses: tenantcloud/template-sync@v1.0.0-alpha.8
uses: tenantcloud/template-sync@v1.0.0-alpha.9
with:
token: ${{ secrets.GITHUB_TOKEN }}

Expand Down
175 changes: 94 additions & 81 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,99 +9,112 @@ jobs:
strategy:
fail-fast: true
matrix:
php: [ 8.1, 8.2 ]
php: [8.2]

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

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
tools: composer:v2
coverage: none

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

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v3
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
- name: Install dependencies
run: composer install --prefer-dist --no-progress

- name: Execute phpunit
run: composer test -- --colors=always
- name: Checkout code
uses: actions/checkout@v3

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
tools: composer:v2
coverage: none

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

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v3
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
- name: Install dependencies
run: composer install --prefer-dist --no-progress

- name: Execute phpunit
run: composer test -- --colors=always

php-cs-fixer:
name: php-cs-fixer
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.1
extensions: dom, curl, libxml, mbstring, zip
tools: composer:v2
coverage: none

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v3
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
- name: Install dependencies
run: composer install --prefer-dist --no-progress

- name: Execute php-cs-fixer
run: composer cs-fix -- --dry-run --diff --using-cache=no
- name: Checkout code
uses: actions/checkout@v3

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.2
extensions: dom, curl, libxml, mbstring, zip
tools: composer:v2
coverage: none

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v3
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
- name: Install dependencies
run: composer install --prefer-dist --no-progress

- name: Execute php-cs-fixer
run: composer cs-fix -- --dry-run --diff --using-cache=no

prettier:
name: Prettier
runs-on: ubuntu-latest

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

- name: Run prettier
uses: actionsx/prettier@v2
with:
args: --check .

phpstan:
name: PHPStan on PHP v${{ matrix.php }}
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
php: [ 8.1, 8.2 ]
php: [8.2]
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
tools: composer:v2
coverage: none

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

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v3
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
- name: Install dependencies
run: composer install --prefer-dist --no-progress

- name: Execute phpstan
run: composer phpstan
- name: Checkout code
uses: actions/checkout@v3

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
tools: composer:v2
coverage: none

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

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v3
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
- name: Install dependencies
run: composer install --prefer-dist --no-progress

- name: Execute phpstan
run: composer phpstan
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
!.idea/fileTemplates

# Dependencies
/vendor/
/vendor
/composer.lock

# Build/coverage
Expand All @@ -16,7 +16,7 @@
**/.phpunit.result.cache

# Temporary
tmp/
/tmp

# Misc
.DS_Store
Expand Down
7 changes: 7 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
CHANGELOG.md

/.idea
/build
/coverage
/tmp
/vendor
1 change: 1 addition & 0 deletions .prettierrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
singleQuote: true
10 changes: 6 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# Commands

Here are some of the commands that you'll need:
- install dependencies: `docker run -it --rm -v $PWD:/app -w /app chialab/php-dev:8.2 composer install`
- run tests with phpunit: `docker run -it --rm -v $PWD:/app -w /app chialab/php-dev:8.2 composer test`
- reformat using php-cs-fixer: `docker run -it --rm -v $PWD:/app -w /app chialab/php-dev:8.2 composer cs-fix`
- analyse with phpstan: `docker run -it --rm -v $PWD:/app -w /app chialab/php-dev:8.2 composer phpstan`

- install dependencies: `docker run -it --rm -v $PWD:/app -w /app chialab/php-dev:8.2 composer install`
- run tests with phpunit: `docker run -it --rm -v $PWD:/app -w /app chialab/php-dev:8.2 composer test`
- reformat using php-cs-fixer: `docker run -it --rm -v $PWD:/app -w /app chialab/php-dev:8.2 composer cs-fix`
- reformat the rest with prettier: `docker run -it --rm -v $PWD:/app -w /app tmknom/prettier --write .`
- analyse with phpstan: `docker run -it --rm -v $PWD:/app -w /app chialab/php-dev:8.2 composer phpstan`
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
## About

Laravel package for https://partner.rentler.com/swagger/index.html Rentler(c) Partner API.

## Installation

In your `composer.json`, add this repository:

```
"repositories": [
{
Expand All @@ -11,9 +14,11 @@ In your `composer.json`, add this repository:
}
],
```

Then do `composer require tenantcloud/rentler-sdk` to install the package.

### Commands

Install dependencies:
`docker run -it --rm -v $PWD:/app -w /app composer install`

Expand Down
Loading

0 comments on commit 9e83413

Please sign in to comment.