Skip to content

Commit

Permalink
Test if package can be required
Browse files Browse the repository at this point in the history
  • Loading branch information
WyriHaximus committed Mar 28, 2021
1 parent efeecbd commit dd6cd0d
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,18 @@ on:
- 'refs/heads/v[0-9]+.[0-9]+.[0-9]+'
pull_request:
jobs:
package-name:
name: Package Name
runs-on: ubuntu-latest
needs:
- lint-json
outputs:
package-name: ${{ steps.package-name.outputs.package-name }}
steps:
- uses: actions/checkout@v1
- id: package-name
run: |
printf "::set-output name=package-name::[\"%s\"]" $(docker run --rm -v "`pwd`:`pwd`" jess/jq jq -r -c '.name' "${GITHUB_WORKSPACE}/composer.json")
supported-versions-matrix:
name: Supported Versions Matrix
runs-on: ubuntu-latest
Expand Down Expand Up @@ -63,6 +75,31 @@ jobs:
- name: Install Dependencies
run: composer update --ansi --no-progress --no-interaction --prefer-dist -o
if: matrix.composer == 'highest'
can-require:
name: Test we can require "${{ matrix.package-name }}" on PHP ${{ matrix.php }}
strategy:
fail-fast: false
matrix:
php: ${{ fromJson(needs.supported-versions-matrix.outputs.version) }}
package-name: ${{ fromJson(needs.package-name.outputs.package-name) }}
needs:
- lint-yaml
- lint-json
- package-name
- supported-versions-matrix
runs-on: ubuntu-latest
container:
image: ghcr.io/wyrihaximusnet/php:${{ matrix.php }}-nts-buster-dev-root
steps:
- uses: actions/checkout@v2
with:
path: checked_out_package
- name: Set Up composer.json
run: |
echo "{\"repositories\": [{\"name\": \"${{ matrix.package-name }}\",\"type\": \"path\",\"url\": \"./checked_out_package\"}]}" > composer.json
- name: Require package
run: |
composer require "${{ matrix.package-name }}:dev-${GITHUB_SHA}" --no-progress --ansi --no-interaction --prefer-dist -o
qa:
name: Run ${{ matrix.check }} on PHP ${{ matrix.php }} with ${{ matrix.composer }} dependency preference
strategy:
Expand Down Expand Up @@ -209,6 +246,7 @@ jobs:
needs:
- lint-yaml
- lint-json
- can-require
- qa
- tests-directly-on-os
- qodana
Expand Down

0 comments on commit dd6cd0d

Please sign in to comment.