Skip to content

Commit

Permalink
Add mirror main CI dispatchable workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
cenkiravul authored Jan 24, 2024
1 parent e971a6f commit 645a6e6
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/test-main-dispatch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Dispatchable CI Workflow

on: [workflow_dispatch]

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
php-version: [8.1]

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

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

- name: Test plugin installation
run: |
echo "{\"http-basic\":{\"repo.magento.com\":{\"username\":\"${MAGENTO_USERNAME}\",\"password\":\"${MAGENTO_PASSWORD}\"}}}" > auth.json
composer install --prefer-dist
env:
CI: true
MAGENTO_USERNAME: ${{ secrets.MAGENTO_USERNAME }}
MAGENTO_PASSWORD: ${{ secrets.MAGENTO_PASSWORD }}

- name: Code Sniffer
run: vendor/bin/phpcs --extensions=php,phtml --error-severity=10 --ignore-annotations

- name: Run PHPUnit
run: vendor/bin/phpunit --coverage-clover=build/clover.xml --log-junit=build/tests-log.xml -c Test/phpunit.xml Test/Unit

- name: Fix code coverage paths
run: sed -i "s;`pwd`/;;g" build/*.xml

- name: SonarCloud Scan
if: ${{ env.SONAR_TOKEN }}
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

0 comments on commit 645a6e6

Please sign in to comment.