-
Notifications
You must be signed in to change notification settings - Fork 211
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ECP-8825] Enable pipeline runs for external contributions (#2451)
* Add e2e flow for external contributors * Add dispatch for debugging * Tweak workflow name * Tweak workflow * Debug * Remove draft pipeline * Update e2e test pipeline * Update GraphQL test pipeline * Update Main CI workflow * Update RestAPI test workflow * DEBUG - Add test pipeline * Add authorization step * DEBUG - Test auth step * Define an internal environment * DEBUG - Try removing auth step and switch to conditional * Remove trial pipeline * Add designated worklfow for debugging * Embed authorize step in build and add conditional * Remove debug pipeline
- Loading branch information
1 parent
2bcff1a
commit da50719
Showing
4 changed files
with
53 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,49 @@ | ||
name: Main CI workflow | ||
|
||
on: [pull_request] | ||
on: [pull_request, pull_request_target] | ||
|
||
jobs: | ||
build: | ||
if: (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository) || (github.event_name == 'pull_request_target' && github.event.pull_request.head.repo.full_name != github.repository) | ||
environment: ${{ (github.event_name == 'pull_request_target' && github.event.pull_request.head.repo.full_name != github.repository) && 'external' || 'internal' }} | ||
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 }} | ||
- 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 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters