|
| 1 | +name: Setup Install Test |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: {} |
| 5 | + push: |
| 6 | + branches: |
| 7 | + - main |
| 8 | + paths: |
| 9 | + - "_test/demo-package/**" |
| 10 | + - "setup-install/**" |
| 11 | + - ".github/workflows/_internal-setup-install.yaml" |
| 12 | + - "supported-version/**" |
| 13 | + - "!(**/*.md)" |
| 14 | + pull_request: |
| 15 | + branches: |
| 16 | + - main |
| 17 | + paths: |
| 18 | + - "_test/demo-package/**" |
| 19 | + - "setup-install/**" |
| 20 | + - ".github/workflows/_internal-setup-install.yaml" |
| 21 | + - "supported-version/**" |
| 22 | + - "!(**/*.md)" |
| 23 | + |
| 24 | +jobs: |
| 25 | + compute_matrix: |
| 26 | + if: "!startsWith(github.head_ref, 'release-please')" |
| 27 | + runs-on: ubuntu-latest |
| 28 | + outputs: |
| 29 | + matrix: ${{ steps.supported-version.outputs.matrix }} |
| 30 | + steps: |
| 31 | + - uses: actions/checkout@v6 |
| 32 | + - uses: ./supported-version |
| 33 | + id: supported-version |
| 34 | + with: |
| 35 | + kind: currently-supported |
| 36 | + include_services: true |
| 37 | + |
| 38 | + setup-install: |
| 39 | + needs: compute_matrix |
| 40 | + strategy: |
| 41 | + matrix: ${{ fromJSON(needs.compute_matrix.outputs.matrix) }} |
| 42 | + fail-fast: false |
| 43 | + runs-on: ${{ matrix.os }} |
| 44 | + services: ${{ matrix.services }} |
| 45 | + steps: |
| 46 | + - uses: actions/checkout@v6 |
| 47 | + |
| 48 | + - uses: ./setup-magento |
| 49 | + id: setup-magento |
| 50 | + with: |
| 51 | + php-version: ${{ matrix.php }} |
| 52 | + tools: composer:v${{ matrix.composer }} |
| 53 | + mode: extension |
| 54 | + magento_version: ${{ matrix.magento }} |
| 55 | + magento_repository: "https://mirror.mage-os.org/" |
| 56 | + composer_auth: ${{ secrets.COMPOSER_AUTH }} |
| 57 | + |
| 58 | + - uses: ./cache-magento |
| 59 | + with: |
| 60 | + composer_cache_key: ${{ matrix.magento }} |
| 61 | + |
| 62 | + - name: Add extension repository |
| 63 | + working-directory: ${{ steps.setup-magento.outputs.path }} |
| 64 | + run: composer config repositories.local path ${{ github.workspace }}/_test/demo-package |
| 65 | + |
| 66 | + - name: Get package name |
| 67 | + id: package |
| 68 | + run: echo "name=$(jq -r .name ${{ github.workspace }}/_test/demo-package/composer.json)" >> $GITHUB_OUTPUT |
| 69 | + |
| 70 | + - name: Require extension |
| 71 | + working-directory: ${{ steps.setup-magento.outputs.path }} |
| 72 | + run: composer require "${{ steps.package.outputs.name }}:@dev" --no-install |
| 73 | + |
| 74 | + - name: Composer install |
| 75 | + working-directory: ${{ steps.setup-magento.outputs.path }} |
| 76 | + run: composer install |
| 77 | + env: |
| 78 | + COMPOSER_AUTH: ${{ secrets.COMPOSER_AUTH }} |
| 79 | + COMPOSER_MIRROR_PATH_REPOS: 1 |
| 80 | + |
| 81 | + - uses: ./setup-install |
| 82 | + with: |
| 83 | + services: ${{ toJSON(matrix.services) }} |
| 84 | + path: ${{ steps.setup-magento.outputs.path }} |
0 commit comments