Skip to content

Commit

Permalink
feat(php idna translator): added new workflows for idna translator an…
Browse files Browse the repository at this point in the history
…d fixed super-linter configuration for php-sdk
  • Loading branch information
AsifNawaz-cnic committed Mar 21, 2024
1 parent 24b32c3 commit 6525837
Show file tree
Hide file tree
Showing 5 changed files with 115 additions and 2 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/auto-merge-dependabot-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -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:
Expand Down
46 changes: 46 additions & 0 deletions .github/workflows/php-idna-translator-release.yml
Original file line number Diff line number Diff line change
@@ -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
48 changes: 48 additions & 0 deletions .github/workflows/php-idna-translator-test.yml
Original file line number Diff line number Diff line change
@@ -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
6 changes: 4 additions & 2 deletions .github/workflows/php-sdk-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 6525837

Please sign in to comment.