diff --git a/.github/workflows/auto-merge-dependabot-pr.yml b/.github/workflows/auto-merge-dependabot-pr.yml index 5b2e8a8..b9de194 100644 --- a/.github/workflows/auto-merge-dependabot-pr.yml +++ b/.github/workflows/auto-merge-dependabot-pr.yml @@ -63,6 +63,13 @@ jobs: permissions: contents: read + php-idna-translator-tests: + if: ${{ contains(inputs.repository, 'php-idna-translator') }} + uses: ./.github/workflows/php-idna-translator-test.yml + secrets: inherit + permissions: + contents: read + dependabot: name: Auto-merge Dependabot PR runs-on: ${{ vars.RTLDEV_MW_CI_OS }} @@ -74,6 +81,7 @@ jobs: - node-sdk-tests - go-sdk-tests - blesta-ispapi-tests + - php-idna-translator-tests - gulp-release-notification-plugin-tests if: ${{ github.actor == 'dependabot[bot]' && (success() || needs.perl-sdk-tests.result == 'success' || needs.python-sdk-tests.result == 'success' || needs.php-sdk-tests.result == 'success' || needs.java-sdk-tests.result == 'success' || needs.node-sdk-tests.result == 'success' || needs.go-sdk-tests.result == 'success' || needs.blesta-ispapi-tests.result == 'success' || needs.gulp-release-notification-plugin-tests.result == 'success') }} permissions: diff --git a/.github/workflows/php-idna-translator-release.yml b/.github/workflows/php-idna-translator-release.yml new file mode 100644 index 0000000..204705f --- /dev/null +++ b/.github/workflows/php-idna-translator-release.yml @@ -0,0 +1,46 @@ +name: Release +on: + workflow_call: + +jobs: + tests: + uses: ./.github/workflows/php-idna-translator-test.yml + secrets: inherit + permissions: + contents: read + + release: + name: Release @ ${{ vars.RTLDEV_MW_CI_OS }} + runs-on: ${{ vars.RTLDEV_MW_CI_OS }} + needs: tests + permissions: + contents: write + issues: write + deployments: write + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + persist-credentials: false + - name: Setup NodeJS ${{ vars.RTLDEV_MW_CI_NODE_VERSION }} + uses: actions/setup-node@v4 + with: + node-version: ${{ vars.RTLDEV_MW_CI_NODE_VERSION }} + check-latest: true + cache: "npm" + - name: Install PHP ${{ vars.RTLDEV_MW_CI_PHP_VERSION }} + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ vars.RTLDEV_MW_CI_PHP_VERSION }} + - name: Install dependencies + run: | + npm ci + echo "$HOME/.composer/vendor/bin" >> "$GITHUB_PATH" + composer update --no-dev + - name: Release + env: + GITHUB_TOKEN: ${{ secrets.RTLDEV_MW_CI_TOKEN }} + TEAMS_NOTIFICATION_URI: ${{ secrets.RTLDEV_MW_CI_NOTIFICATION_URI }} + COMMIT_SHA: ${{ github.sha }} + run: npx semantic-release diff --git a/.github/workflows/php-idna-translator-test.yml b/.github/workflows/php-idna-translator-test.yml new file mode 100644 index 0000000..edde48f --- /dev/null +++ b/.github/workflows/php-idna-translator-test.yml @@ -0,0 +1,48 @@ +name: Linting & Coverage +on: + workflow_call: + +jobs: + lint: + name: 🧪 Linting + runs-on: ${{ vars.RTLDEV_MW_CI_OS }} + permissions: + contents: read + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + persist-credentials: false + - name: Super Linter Code Base + uses: github/super-linter/slim@v5 + env: + FILTER_REGEX_INCLUDE: "/src/*|/tests/*" + DEFAULT_BRANCH: main + VALIDATE_PHP: true + VALIDATE_PHP_PHPCS: true + VALIDATE_PHP_PHPSTAN: true + VALIDATE_ALL_CODEBASE: false + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + test_matrix: + name: 🧪 Testing + runs-on: ${{ vars.RTLDEV_MW_CI_OS }} + needs: lint + permissions: + contents: read + strategy: + matrix: + php-version: ${{ fromJson(vars.RTLDEV_MW_CI_PHP_MATRIX) }} + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + persist-credentials: false + - name: Install Dependencies::PHP${{ matrix.php-version }} + run: | + echo "$HOME/.composer/vendor/bin" >> "$GITHUB_PATH" + composer update + - name: Code Validation + run: composer run-script test \ No newline at end of file diff --git a/.github/workflows/php-sdk-test.yml b/.github/workflows/php-sdk-test.yml index 38067e4..993d622 100644 --- a/.github/workflows/php-sdk-test.yml +++ b/.github/workflows/php-sdk-test.yml @@ -17,9 +17,11 @@ jobs: - name: Super Linter Code Base uses: github/super-linter/slim@v5 env: - FILTER_REGEX_INCLUDE: "((/src/main/.*.java)|updateVersion.sh)" + FILTER_REGEX_INCLUDE: "/src/*|/tests/*|updateVersion.sh" DEFAULT_BRANCH: master - VALIDATE_JAVA: true + VALIDATE_PHP: true + VALIDATE_PHP_PHPCS: true + VALIDATE_PHP_PHPSTAN: true VALIDATE_BASH: true VALIDATE_ALL_CODEBASE: false GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index bb154fb..75b8b2f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -78,3 +78,12 @@ jobs: contents: write issues: write deployments: write + + php-idna-translator-release: + if: ${{ contains(inputs.repository, 'php-idna-translator') }} + uses: ./.github/workflows/php-idna-translator-release.yml + secrets: inherit + permissions: + contents: write + issues: write + deployments: write