Skip to content

Commit 0f072ba

Browse files
authored
ci: easy repo switching (#192)
1 parent 01cbea1 commit 0f072ba

File tree

3 files changed

+22
-1
lines changed

3 files changed

+22
-1
lines changed

.github/workflows/_internal-install.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ on:
2121
- "supported-version/**"
2222
- "!(**/*.md)"
2323

24+
env:
25+
MAGENTO_COMPOSER_REPO: "https://mirror.mage-os.org/"
26+
2427
jobs:
2528
compute_matrix:
2629
runs-on: ubuntu-latest
@@ -49,3 +52,5 @@ jobs:
4952
magento_version: ${{ matrix.magento }}
5053
package_name: mage-os/magento2-demo-package
5154
source_folder: $GITHUB_WORKSPACE/_test/demo-package
55+
composer_auth: ${{ secrets.COMPOSER_AUTH }}
56+
magento_repository: ${{ env.MAGENTO_COMPOSER_REPO }}

.github/workflows/_internal-integration.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,5 @@ jobs:
4242
matrix: ${{ needs.compute_matrix.outputs.matrix }}
4343
test_command: ../../../vendor/bin/phpunit ../../../vendor/mage-os/magento2-demo-package/Test/Integration
4444
fail-fast: false
45+
secrets:
46+
composer_auth: ${{ secrets.COMPOSER_AUTH }}

.github/workflows/_internal-setup-magento.yaml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ on:
2222
env:
2323
PSEUDO_REPO_FOLDER: ../magento_repo
2424
magento_folder: ../magento2
25+
MAGENTO_COMPOSER_REPO: "https://mirror.mage-os.org/"
2526

2627
jobs:
2728
compute_matrix:
@@ -63,20 +64,26 @@ jobs:
6364
key: setup-magento-ci | ${{ runner.os }} | ${{ matrix.magento }}
6465
path: ${{ env.PSEUDO_STORE_FULL_PATH }}
6566

66-
- run: composer create-project --repository-url="https://mirror.mage-os.org" "${{ matrix.magento }}" "${{ env.PSEUDO_REPO_FOLDER }}" --no-install
67+
- run: composer create-project --repository-url="${{ env.MAGENTO_COMPOSER_REPO }}" "${{ matrix.magento }}" "${{ env.PSEUDO_REPO_FOLDER }}" --no-install
6768
name: Create Store to simulate a real Magento store in a real repo.
6869
if: steps.setup-magento-store-cache.outputs.cache-hit != 'true'
70+
env:
71+
COMPOSER_AUTH: ${{ secrets.COMPOSER_AUTH }}
6972

7073
- uses: ./fix-magento-install
7174
name: Fix Magento Out of Box Install Issues
7275
with:
7376
magento_directory: ${{ env.PSEUDO_REPO_FOLDER }}
7477
if: steps.setup-magento-store-cache.outputs.cache-hit != 'true'
78+
env:
79+
COMPOSER_AUTH: ${{ secrets.COMPOSER_AUTH }}
7580

7681
- run: composer install
7782
shell: bash
7883
working-directory: "${{ env.PSEUDO_REPO_FOLDER }}"
7984
if: steps.setup-magento-store-cache.outputs.cache-hit != 'true'
85+
env:
86+
COMPOSER_AUTH: ${{ secrets.COMPOSER_AUTH }}
8087

8188
- run: git init && git config user.email "[email protected]" && git config user.name "Your Name" && git add . && git commit -m "init" && git clean -fdx
8289
working-directory: "${{ env.PSEUDO_REPO_FOLDER }}"
@@ -92,6 +99,7 @@ jobs:
9299
tools: composer:v${{ matrix.composer }}
93100
mode: store
94101
working-directory: ${{ env.magento_folder }}
102+
composer_auth: ${{ secrets.COMPOSER_AUTH }}
95103

96104
- uses: graycoreio/github-actions-magento2/cache-magento@main
97105
with:
@@ -102,6 +110,8 @@ jobs:
102110
name: Composer install
103111
shell: bash
104112
working-directory: ${{ steps.setup-magento.outputs.path }}
113+
env:
114+
COMPOSER_AUTH: ${{ secrets.COMPOSER_AUTH }}
105115

106116
setup-magento-extension:
107117
runs-on: ubuntu-latest
@@ -115,6 +125,8 @@ jobs:
115125
tools: composer:v2
116126
mode: extension
117127
magento_version: magento/project-community-edition:2.4.5-p1
128+
magento_repository: ${{ env.MAGENTO_COMPOSER_REPO }}
129+
composer_auth: ${{ secrets.COMPOSER_AUTH }}
118130

119131
- uses: graycoreio/github-actions-magento2/cache-magento@main
120132
with:
@@ -125,3 +137,5 @@ jobs:
125137
name: Composer install
126138
shell: bash
127139
working-directory: ${{ steps.setup-magento.outputs.path }}
140+
env:
141+
COMPOSER_AUTH: ${{ secrets.COMPOSER_AUTH }}

0 commit comments

Comments
 (0)