|
6 | 6 | - 'master'
|
7 | 7 | - 'refs/heads/v[0-9]+.[0-9]+.[0-9]+'
|
8 | 8 | pull_request:
|
| 9 | +## This workflow needs the `pull-request` permissions to work for the package diffing |
| 10 | +## Refs: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#permissions |
| 11 | +permissions: |
| 12 | + pull-requests: write |
| 13 | + contents: read |
9 | 14 | jobs:
|
10 |
| - supported-versions-matrix: |
11 |
| - name: Supported Versions Matrix |
12 |
| - runs-on: ubuntu-latest |
13 |
| - needs: |
14 |
| - - lint-yaml |
15 |
| - - lint-json |
16 |
| - outputs: |
17 |
| - version: ${{ steps.supported-versions-matrix.outputs.version }} |
18 |
| - steps: |
19 |
| - - uses: actions/checkout@v1 |
20 |
| - - id: supported-versions-matrix |
21 |
| - uses: WyriHaximus/github-action-composer-php-versions-in-range@v1 |
22 |
| - supported-checks-matrix: |
23 |
| - name: Supported Checks Matrix |
24 |
| - runs-on: ubuntu-latest |
25 |
| - needs: |
26 |
| - - lint-yaml |
27 |
| - - composer-install |
28 |
| - outputs: |
29 |
| - check: ${{ steps.supported-checks-matrix.outputs.check }} |
30 |
| - steps: |
31 |
| - - uses: actions/checkout@v1 |
32 |
| - - id: supported-checks-matrix |
33 |
| - name: Generate check |
34 |
| - run: | |
35 |
| - printf "Checks found: %s\r\n" $(make task-list-ci) |
36 |
| - printf "::set-output name=check::%s" $(make task-list-ci) |
37 |
| - composer-install: |
38 |
| - strategy: |
39 |
| - fail-fast: false |
40 |
| - matrix: |
41 |
| - php: ${{ fromJson(needs.supported-versions-matrix.outputs.version) }} |
42 |
| - composer: [lowest, current, highest] |
43 |
| - needs: |
44 |
| - - lint-yaml |
45 |
| - - lint-json |
46 |
| - - supported-versions-matrix |
47 |
| - runs-on: ubuntu-latest |
48 |
| - container: |
49 |
| - image: ghcr.io/wyrihaximusnet/php:${{ matrix.php }}-nts-buster-dev-root |
50 |
| - steps: |
51 |
| - - uses: actions/checkout@v1 |
52 |
| - - name: Cache composer packages |
53 |
| - uses: actions/cache@v1 |
54 |
| - with: |
55 |
| - path: ./vendor/ |
56 |
| - key: ${{ matrix.composer }}-${{ matrix.php }}-${{ hashFiles('**/composer.lock') }} |
57 |
| - - name: Install Dependencies |
58 |
| - run: composer update --prefer-lowest --no-progress --ansi --no-interaction --prefer-dist -o |
59 |
| - if: matrix.composer == 'lowest' |
60 |
| - - name: Install Dependencies |
61 |
| - run: composer install --ansi --no-progress --no-interaction --prefer-dist -o |
62 |
| - if: matrix.composer == 'current' |
63 |
| - - name: Install Dependencies |
64 |
| - run: composer update --ansi --no-progress --no-interaction --prefer-dist -o |
65 |
| - if: matrix.composer == 'highest' |
66 |
| - qa: |
67 |
| - name: Run ${{ matrix.check }} on PHP ${{ matrix.php }} with ${{ matrix.composer }} dependency preference (Linux) |
68 |
| - strategy: |
69 |
| - fail-fast: false |
70 |
| - matrix: |
71 |
| - php: ${{ fromJson(needs.supported-versions-matrix.outputs.version) }} |
72 |
| - composer: [lowest, current, highest] |
73 |
| - check: ${{ fromJson(needs.supported-checks-matrix.outputs.check) }} |
74 |
| - needs: |
75 |
| - - lint-yaml |
76 |
| - - lint-json |
77 |
| - - composer-install |
78 |
| - - supported-checks-matrix |
79 |
| - - supported-versions-matrix |
80 |
| - runs-on: ubuntu-latest |
81 |
| - container: |
82 |
| - image: ghcr.io/wyrihaximusnet/php:${{ matrix.php }}-nts-buster-dev-root |
83 |
| - steps: |
84 |
| - - uses: actions/checkout@v1 |
85 |
| - - name: Cache composer packages |
86 |
| - uses: actions/cache@v1 |
87 |
| - with: |
88 |
| - path: ./vendor/ |
89 |
| - key: ${{ matrix.composer }}-${{ matrix.php }}-${{ hashFiles('**/composer.lock') }} |
90 |
| - - name: Install Dependencies |
91 |
| - run: (test -f vendor && true ) || composer update --prefer-lowest --no-progress --ansi --no-interaction --prefer-dist -o |
92 |
| - if: matrix.composer == 'lowest' |
93 |
| - - name: Install Dependencies |
94 |
| - run: (test -f vendor && true ) || composer install --ansi --no-progress --no-interaction --prefer-dist -o |
95 |
| - if: matrix.composer == 'current' |
96 |
| - - name: Install Dependencies |
97 |
| - run: (test -f vendor && true ) || composer update --ansi --no-progress --no-interaction --prefer-dist -o |
98 |
| - if: matrix.composer == 'highest' |
99 |
| - - name: Fetch Tags |
100 |
| - run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* || true |
101 |
| - if: matrix.check == 'backward-compatibility-check' |
102 |
| - - run: make ${{ matrix.check }} |
103 |
| - env: |
104 |
| - COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} |
105 |
| - COVERALLS_RUN_LOCALLY: ${{ secrets.COVERALLS_RUN_LOCALLY }} |
106 |
| - unittests-directly-on-os: |
107 |
| - name: Run unit tests on PHP ${{ matrix.php }} with ${{ matrix.composer }} dependency preference (${{ matrix.os }}) |
108 |
| - strategy: |
109 |
| - fail-fast: false |
110 |
| - matrix: |
111 |
| - os: [ubuntu-latest, windows-latest, macos-latest] |
112 |
| - php: ${{ fromJson(needs.supported-versions-matrix.outputs.version) }} |
113 |
| - composer: [lowest, current, highest] |
114 |
| - needs: |
115 |
| - - lint-yaml |
116 |
| - - lint-json |
117 |
| - - composer-install |
118 |
| - - supported-versions-matrix |
119 |
| - runs-on: ${{ matrix.os }} |
120 |
| - steps: |
121 |
| - - uses: actions/checkout@v1 |
122 |
| - - name: Setup PHP, extensions and composer with shivammathur/setup-php |
123 |
| - uses: shivammathur/setup-php@v2 |
124 |
| - with: |
125 |
| - php-version: ${{ matrix.php }} |
126 |
| - coverage: xdebug, pcov |
127 |
| - - name: Cache composer packages |
128 |
| - uses: actions/cache@v1 |
129 |
| - with: |
130 |
| - path: ./vendor/ |
131 |
| - key: ${{ matrix.composer }}-${{ matrix.php }}-${{ hashFiles('**/composer.lock') }} |
132 |
| - - name: Install Dependencies |
133 |
| - run: (test -f vendor && true ) || composer update --prefer-lowest --no-progress --ansi --no-interaction --prefer-dist -o |
134 |
| - if: matrix.composer == 'lowest' |
135 |
| - - name: Install Dependencies |
136 |
| - run: (test -f vendor && true ) || composer install --ansi --no-progress --no-interaction --prefer-dist -o |
137 |
| - if: matrix.composer == 'current' |
138 |
| - - name: Install Dependencies |
139 |
| - run: (test -f vendor && true ) || composer update --ansi --no-progress --no-interaction --prefer-dist -o |
140 |
| - if: matrix.composer == 'highest' |
141 |
| - - name: Fetch Tags |
142 |
| - run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* || true |
143 |
| - if: matrix.check == 'backward-compatibility-check' |
144 |
| - - run: | |
145 |
| - ./vendor/bin/phpunit -c ./etc/qa/phpunit.xml |
146 |
| - php ./examples/advanced-own-child-process/index.php |
147 |
| - php ./examples/error/index.php |
148 |
| - php ./examples/messages/index.php |
149 |
| - php ./examples/overflow/index.php |
150 |
| - php ./examples/prime/index.php |
151 |
| - php ./examples/return-class/index.php |
152 |
| - php ./examples/return-class-messaging/index.php |
153 |
| - php ./examples/secure-messages/index.php |
154 |
| - php ./examples/secure-return-class/index.php |
155 |
| - php ./examples/time-format/index.php |
156 |
| - env: |
157 |
| - COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} |
158 |
| - COVERALLS_RUN_LOCALLY: ${{ secrets.COVERALLS_RUN_LOCALLY }} |
159 |
| - lint-yaml: |
160 |
| - name: Lint YAML |
161 |
| - runs-on: ubuntu-latest |
162 |
| - steps: |
163 |
| - - uses: actions/checkout@v1 |
164 |
| - - name: yaml-lint |
165 |
| - uses: ibiqlik/action-yamllint@v3 |
166 |
| - with: |
167 |
| - config_data: | |
168 |
| - extends: default |
169 |
| - ignore: | |
170 |
| - /.git/ |
171 |
| - rules: |
172 |
| - line-length: disable |
173 |
| - document-start: disable |
174 |
| - truthy: disable |
175 |
| - lint-json: |
176 |
| - name: Lint JSON |
177 |
| - runs-on: ubuntu-latest |
178 |
| - steps: |
179 |
| - - uses: actions/checkout@v1 |
180 |
| - - name: json-syntax-check |
181 |
| - uses: limitusus/json-syntax-check@v1 |
182 |
| - with: |
183 |
| - pattern: "\\.json$" |
184 |
| - check-mark: |
185 |
| - name: ✔️ |
186 |
| - needs: |
187 |
| - - lint-yaml |
188 |
| - - lint-json |
189 |
| - - qa |
190 |
| - - unittests-directly-on-os |
191 |
| - runs-on: ubuntu-latest |
192 |
| - steps: |
193 |
| - - run: echo "✔️" |
| 15 | + ci: |
| 16 | + name: Continuous Integration |
| 17 | + uses: WyriHaximus/github-workflows/.github/workflows/package.yaml@main |
0 commit comments