diff --git a/.github/workflows/build-and-deploy-docs.yml b/.github/workflows/build-and-deploy-docs.yml index cc0573e..69039c3 100644 --- a/.github/workflows/build-and-deploy-docs.yml +++ b/.github/workflows/build-and-deploy-docs.yml @@ -1,6 +1,6 @@ name: Build and Deploy Docs env: - DOCS_DEST_DIR: /twigpack/ + DOCS_DEST_DIR: /twigpack/v1/ on: push: branches: @@ -22,11 +22,11 @@ jobs: strategy: fail-fast: true matrix: - node-version: [14.x] + node-version: [ 20.x ] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v2 + uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} - run: npm ci diff --git a/.github/workflows/code-analysis.yaml b/.github/workflows/code-analysis.yaml new file mode 100644 index 0000000..d4bf3fa --- /dev/null +++ b/.github/workflows/code-analysis.yaml @@ -0,0 +1,40 @@ +name: Code Analysis + +on: + pull_request: null + push: + branches: + - develop + workflow_dispatch: +permissions: + contents: read +jobs: + code_analysis: + strategy: + fail-fast: false + matrix: + actions: + - name: 'PHPStan' + run: composer phpstan + - name: 'Coding Standards' + run: composer fix-cs + name: ${{ matrix.actions.name }} + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Cache Composer dependencies + uses: actions/cache@v4 + with: + path: /tmp/composer-cache + key: ${{ runner.os }}-${{ hashFiles('**/composer.lock') }} + - name: Setup PHP + id: setup-php + uses: shivammathur/setup-php@v2 + with: + php-version: 8.2 + extensions: 'ctype,curl,dom,iconv,imagick,intl,json,mbstring,openssl,pcre,pdo,reflection,spl,zip' + ini-values: post_max_size=256M, max_execution_time=180, memory_limit=512M + tools: composer:v2 + - name: Install Composer dependencies + run: composer install --no-interaction --no-ansi --no-progress + - run: ${{ matrix.actions.run }} diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml new file mode 100644 index 0000000..8e33492 --- /dev/null +++ b/.github/workflows/create-release.yml @@ -0,0 +1,21 @@ +name: Create Release +run-name: Create release for ${{ github.event.client_payload.version }} + +on: + repository_dispatch: + types: + - craftcms/new-release + +jobs: + build: + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - uses: ncipollo/release-action@v1 + with: + body: ${{ github.event.client_payload.notes }} + makeLatest: ${{ github.event.client_payload.latest }} + name: ${{ github.event.client_payload.version }} + prerelease: ${{ github.event.client_payload.prerelease }} + tag: ${{ github.event.client_payload.tag }} diff --git a/ecs.php b/ecs.php new file mode 100644 index 0000000..dfff63b --- /dev/null +++ b/ecs.php @@ -0,0 +1,13 @@ +paths([ + __DIR__ . '/src', + __FILE__, + ]); + $ecsConfig->parallel(); + $ecsConfig->sets([SetList::CRAFT_CMS_3]); +}; diff --git a/phpstan.neon b/phpstan.neon new file mode 100644 index 0000000..9ad1308 --- /dev/null +++ b/phpstan.neon @@ -0,0 +1,7 @@ +includes: + - %currentWorkingDirectory%/vendor/craftcms/phpstan/phpstan.neon + +parameters: + level: 5 + paths: + - src