|
| 1 | +name: Continuous Integration |
| 2 | +on: |
| 3 | + push: |
| 4 | + pull_request: |
| 5 | +jobs: |
| 6 | + package-name: |
| 7 | + name: Package Name |
| 8 | + runs-on: ubuntu-latest |
| 9 | + needs: |
| 10 | + - lint-json |
| 11 | + outputs: |
| 12 | + package-name: ${{ steps.package-name.outputs.package-name }} |
| 13 | + steps: |
| 14 | + - uses: actions/checkout@v1 |
| 15 | + - id: package-name |
| 16 | + run: | |
| 17 | + printf "::set-output name=package-name::[\"%s\"]" $(docker run --rm -v "`pwd`:`pwd`" jess/jq jq -r -c '.name' "${GITHUB_WORKSPACE}/composer.json") |
| 18 | + supported-versions-matrix: |
| 19 | + name: Supported Versions Matrix |
| 20 | + runs-on: ubuntu-latest |
| 21 | + needs: |
| 22 | + - lint-yaml |
| 23 | + - lint-json |
| 24 | + outputs: |
| 25 | + version: ${{ steps.supported-versions-matrix.outputs.version }} |
| 26 | + steps: |
| 27 | + - uses: actions/checkout@v1 |
| 28 | + - id: supported-versions-matrix |
| 29 | + uses: WyriHaximus/github-action-composer-php-versions-in-range@v1 |
| 30 | + supported-checks-matrix: |
| 31 | + name: Supported Checks Matrix |
| 32 | + runs-on: ubuntu-latest |
| 33 | + needs: |
| 34 | + - lint-yaml |
| 35 | + - composer-install |
| 36 | + outputs: |
| 37 | + check: ${{ steps.supported-checks-matrix.outputs.check }} |
| 38 | + steps: |
| 39 | + - uses: actions/checkout@v1 |
| 40 | + - id: supported-checks-matrix |
| 41 | + name: Generate check |
| 42 | + run: | |
| 43 | + printf "Checks found: %s\r\n" $(make task-list-ci) |
| 44 | + printf "::set-output name=check::%s" $(make task-list-ci) |
| 45 | + composer-install: |
| 46 | + strategy: |
| 47 | + fail-fast: false |
| 48 | + matrix: |
| 49 | + php: ${{ fromJson(needs.supported-versions-matrix.outputs.version) }} |
| 50 | + composer: [lowest, current, highest] |
| 51 | + needs: |
| 52 | + - lint-yaml |
| 53 | + - lint-json |
| 54 | + - supported-versions-matrix |
| 55 | + runs-on: ubuntu-latest |
| 56 | + container: |
| 57 | + image: ghcr.io/wyrihaximusnet/php:${{ matrix.php }}-nts-buster-dev-root |
| 58 | + steps: |
| 59 | + - uses: actions/checkout@v1 |
| 60 | + - name: Cache composer packages |
| 61 | + uses: actions/cache@v1 |
| 62 | + with: |
| 63 | + path: ./vendor/ |
| 64 | + key: ${{ matrix.composer }}-${{ matrix.php }}-${{ hashFiles('**/composer.lock') }} |
| 65 | + - name: Install Dependencies |
| 66 | + run: composer update --prefer-lowest --no-progress --ansi --no-interaction --prefer-dist -o |
| 67 | + if: matrix.composer == 'lowest' |
| 68 | + - name: Install Dependencies |
| 69 | + run: composer install --ansi --no-progress --no-interaction --prefer-dist -o |
| 70 | + if: matrix.composer == 'current' |
| 71 | + - name: Install Dependencies |
| 72 | + run: composer update --ansi --no-progress --no-interaction --prefer-dist -o |
| 73 | + if: matrix.composer == 'highest' |
| 74 | + qa: |
| 75 | + strategy: |
| 76 | + fail-fast: false |
| 77 | + matrix: |
| 78 | + php: ${{ fromJson(needs.supported-versions-matrix.outputs.version) }} |
| 79 | + composer: [lowest, current, highest] |
| 80 | + check: ${{ fromJson(needs.supported-checks-matrix.outputs.check) }} |
| 81 | + needs: |
| 82 | + - lint-yaml |
| 83 | + - lint-json |
| 84 | + - composer-install |
| 85 | + - supported-checks-matrix |
| 86 | + - supported-versions-matrix |
| 87 | + runs-on: ubuntu-latest |
| 88 | + container: |
| 89 | + image: ghcr.io/wyrihaximusnet/php:${{ matrix.php }}-nts-buster-dev-root |
| 90 | + steps: |
| 91 | + - uses: actions/checkout@v1 |
| 92 | + - name: Cache composer packages |
| 93 | + uses: actions/cache@v1 |
| 94 | + with: |
| 95 | + path: ./vendor/ |
| 96 | + key: ${{ matrix.composer }}-${{ matrix.php }}-${{ hashFiles('**/composer.lock') }} |
| 97 | + - name: Install Dependencies |
| 98 | + run: (test -f vendor && true ) || composer update --prefer-lowest --no-progress --ansi --no-interaction --prefer-dist -o |
| 99 | + if: matrix.composer == 'lowest' |
| 100 | + - name: Install Dependencies |
| 101 | + run: (test -f vendor && true ) || composer install --ansi --no-progress --no-interaction --prefer-dist -o |
| 102 | + if: matrix.composer == 'current' |
| 103 | + - name: Install Dependencies |
| 104 | + run: (test -f vendor && true ) || composer update --ansi --no-progress --no-interaction --prefer-dist -o |
| 105 | + if: matrix.composer == 'highest' |
| 106 | + - name: Fetch Tags |
| 107 | + run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* || true |
| 108 | + if: matrix.check == 'backward-compatibility-check' |
| 109 | + - run: make ${{ matrix.check }} |
| 110 | + env: |
| 111 | + COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} |
| 112 | + COVERALLS_RUN_LOCALLY: ${{ secrets.COVERALLS_RUN_LOCALLY }} |
| 113 | + lint-yaml: |
| 114 | + name: Lint YAML |
| 115 | + runs-on: ubuntu-latest |
| 116 | + steps: |
| 117 | + - uses: actions/checkout@v1 |
| 118 | + - name: yaml-lint |
| 119 | + uses: ibiqlik/action-yamllint@v3 |
| 120 | + with: |
| 121 | + config_data: | |
| 122 | + extends: default |
| 123 | + rules: |
| 124 | + line-length: disable |
| 125 | + document-start: disable |
| 126 | + truthy: disable |
| 127 | + lint-json: |
| 128 | + name: Lint JSON |
| 129 | + runs-on: ubuntu-latest |
| 130 | + steps: |
| 131 | + - uses: actions/checkout@v1 |
| 132 | + - name: json-syntax-check |
| 133 | + uses: limitusus/json-syntax-check@v1 |
| 134 | + with: |
| 135 | + pattern: "\\.json$" |
| 136 | + check-mark: |
| 137 | + name: ✔️ |
| 138 | + needs: |
| 139 | + - lint-yaml |
| 140 | + - lint-json |
| 141 | + - qa |
| 142 | + runs-on: ubuntu-latest |
| 143 | + steps: |
| 144 | + - run: echo "✔️" |
0 commit comments