|
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 |
| - package-name: |
11 |
| - name: Package Name |
12 |
| - runs-on: ubuntu-latest |
13 |
| - needs: |
14 |
| - - lint-json |
15 |
| - outputs: |
16 |
| - package-name: ${{ steps.package-name.outputs.package-name }} |
17 |
| - steps: |
18 |
| - - uses: actions/checkout@v4 |
19 |
| - - id: package-name |
20 |
| - run: | |
21 |
| - printf "::set-output name=package-name::[\"%s\"]" $(docker run --rm -v "`pwd`:`pwd`" jess/jq jq -r -c '.name' "${GITHUB_WORKSPACE}/composer.json") |
22 |
| - supported-versions-matrix: |
23 |
| - name: Supported Versions Matrix |
24 |
| - runs-on: ubuntu-latest |
25 |
| - needs: |
26 |
| - - lint-yaml |
27 |
| - - lint-json |
28 |
| - outputs: |
29 |
| - version: ${{ steps.supported-versions-matrix.outputs.version }} |
30 |
| - upcoming: ${{ steps.supported-versions-matrix.outputs.upcoming }} |
31 |
| - steps: |
32 |
| - - uses: actions/checkout@v4 |
33 |
| - - id: supported-versions-matrix |
34 |
| - uses: WyriHaximus/github-action-composer-php-versions-in-range@v1 |
35 |
| - with: |
36 |
| - upcomingReleases: true |
37 |
| - supported-checks-matrix: |
38 |
| - name: Supported Checks Matrix |
39 |
| - runs-on: ubuntu-latest |
40 |
| - needs: |
41 |
| - - lint-yaml |
42 |
| - outputs: |
43 |
| - check: ${{ steps.supported-checks-matrix.outputs.check }} |
44 |
| - steps: |
45 |
| - - uses: actions/checkout@v4 |
46 |
| - - id: supported-checks-matrix |
47 |
| - name: Generate check |
48 |
| - run: | |
49 |
| - printf "Checks found: %s\r\n" $(make task-list-ci) |
50 |
| - printf "::set-output name=check::%s" $(make task-list-ci) |
51 |
| - can-require: |
52 |
| - name: Test we can require "${{ matrix.package-name }}" on PHP ${{ matrix.php }} |
53 |
| - strategy: |
54 |
| - fail-fast: false |
55 |
| - matrix: |
56 |
| - php: ${{ fromJson(needs.supported-versions-matrix.outputs.version) }} |
57 |
| - package-name: ${{ fromJson(needs.package-name.outputs.package-name) }} |
58 |
| - needs: |
59 |
| - - lint-yaml |
60 |
| - - lint-json |
61 |
| - - package-name |
62 |
| - - supported-versions-matrix |
63 |
| - runs-on: ubuntu-latest |
64 |
| - container: |
65 |
| - image: ghcr.io/wyrihaximusnet/php:${{ matrix.php }}-nts-buster-dev-root |
66 |
| - steps: |
67 |
| - - uses: actions/checkout@v4 |
68 |
| - with: |
69 |
| - path: checked_out_package |
70 |
| - - name: Set Up composer.json |
71 |
| - run: | |
72 |
| - echo "{\"repositories\": [{\"name\": \"${{ matrix.package-name }}\",\"type\": \"path\",\"url\": \"./checked_out_package\"}]}" > composer.json |
73 |
| - - name: Require package |
74 |
| - if: needs.supported-versions-matrix.outputs.upcoming != matrix.php |
75 |
| - run: | |
76 |
| - composer require "${{ matrix.package-name }}:dev-${GITHUB_SHA}" --no-progress --ansi --no-interaction --prefer-dist -o || composer require "${{ matrix.package-name }}:dev-${GITHUB_REF_NAME}" --no-progress --ansi --no-interaction --prefer-dist -o |
77 |
| - qa: |
78 |
| - name: Run ${{ matrix.check }} on PHP ${{ matrix.php }} with ${{ matrix.composer }} dependency preference |
79 |
| - strategy: |
80 |
| - fail-fast: false |
81 |
| - matrix: |
82 |
| - php: ${{ fromJson(needs.supported-versions-matrix.outputs.version) }} |
83 |
| - composer: [lowest, locked, highest] |
84 |
| - check: ${{ fromJson(needs.supported-checks-matrix.outputs.check) }} |
85 |
| - needs: |
86 |
| - - lint-yaml |
87 |
| - - lint-json |
88 |
| - - supported-checks-matrix |
89 |
| - - supported-versions-matrix |
90 |
| - runs-on: ubuntu-latest |
91 |
| - container: |
92 |
| - image: ghcr.io/wyrihaximusnet/php:${{ matrix.php }}-nts-buster-dev-root |
93 |
| - steps: |
94 |
| - - uses: actions/checkout@v4 |
95 |
| - - uses: ramsey/composer-install@v2 |
96 |
| - with: |
97 |
| - dependency-versions: ${{ matrix.composer }} |
98 |
| - - name: Fetch Tags |
99 |
| - run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* || true |
100 |
| - if: matrix.check == 'backward-compatibility-check' |
101 |
| - - run: make ${{ matrix.check }} || true |
102 |
| - if: needs.supported-versions-matrix.outputs.upcoming == matrix.php |
103 |
| - env: |
104 |
| - COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} |
105 |
| - COVERALLS_RUN_LOCALLY: ${{ secrets.COVERALLS_RUN_LOCALLY }} |
106 |
| - - run: make ${{ matrix.check }} |
107 |
| - if: needs.supported-versions-matrix.outputs.upcoming != matrix.php |
108 |
| - env: |
109 |
| - COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} |
110 |
| - COVERALLS_RUN_LOCALLY: ${{ secrets.COVERALLS_RUN_LOCALLY }} |
111 |
| - tests-directly-on-os: |
112 |
| - name: Run tests on PHP ${{ matrix.php }} with ${{ matrix.composer }} dependency preference (${{ matrix.os }}) |
113 |
| - strategy: |
114 |
| - fail-fast: false |
115 |
| - matrix: |
116 |
| - os: [ubuntu-latest, windows-latest, macos-latest] |
117 |
| - php: ${{ fromJson(needs.supported-versions-matrix.outputs.version) }} |
118 |
| - composer: [lowest, locked, highest] |
119 |
| - needs: |
120 |
| - - lint-yaml |
121 |
| - - lint-json |
122 |
| - - supported-checks-matrix |
123 |
| - - supported-versions-matrix |
124 |
| - runs-on: ${{ matrix.os }} |
125 |
| - steps: |
126 |
| - - uses: actions/checkout@v4 |
127 |
| - - uses: shivammathur/setup-php@v2 |
128 |
| - with: |
129 |
| - php-version: ${{ matrix.php }} |
130 |
| - coverage: pcov |
131 |
| - extensions: intl, sodium |
132 |
| - - uses: ramsey/composer-install@v2 |
133 |
| - with: |
134 |
| - dependency-versions: ${{ matrix.composer }} |
135 |
| - - run: make unit-testing-raw || true |
136 |
| - if: needs.supported-versions-matrix.outputs.upcoming == matrix.php |
137 |
| - env: |
138 |
| - COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} |
139 |
| - COVERALLS_RUN_LOCALLY: ${{ secrets.COVERALLS_RUN_LOCALLY }} |
140 |
| - - run: make unit-testing-raw |
141 |
| - if: needs.supported-versions-matrix.outputs.upcoming != matrix.php |
142 |
| - env: |
143 |
| - COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} |
144 |
| - COVERALLS_RUN_LOCALLY: ${{ secrets.COVERALLS_RUN_LOCALLY }} |
145 |
| - lint-yaml: |
146 |
| - name: Lint YAML |
147 |
| - runs-on: ubuntu-latest |
148 |
| - steps: |
149 |
| - - uses: actions/checkout@v4 |
150 |
| - - name: yaml-lint |
151 |
| - uses: ibiqlik/action-yamllint@v3 |
152 |
| - with: |
153 |
| - config_data: | |
154 |
| - extends: default |
155 |
| - ignore: | |
156 |
| - /.git/ |
157 |
| - rules: |
158 |
| - line-length: disable |
159 |
| - document-start: disable |
160 |
| - truthy: disable |
161 |
| - lint-json: |
162 |
| - name: Lint JSON |
163 |
| - runs-on: ubuntu-latest |
164 |
| - steps: |
165 |
| - - uses: actions/checkout@v4 |
166 |
| - - name: json-syntax-check |
167 |
| - uses: limitusus/json-syntax-check@v2 |
168 |
| - with: |
169 |
| - pattern: "\\.json$" |
170 |
| - check-mark: |
171 |
| - name: ✔️ |
172 |
| - needs: |
173 |
| - - lint-yaml |
174 |
| - - lint-json |
175 |
| - - can-require |
176 |
| - - qa |
177 |
| - - tests-directly-on-os |
178 |
| - runs-on: ubuntu-latest |
179 |
| - steps: |
180 |
| - - run: echo "✔️" |
| 15 | + ci: |
| 16 | + name: Continuous Integration |
| 17 | + uses: WyriHaximus/github-workflows/.github/workflows/package.yaml@main |
0 commit comments