Skip to content

Commit 2be39d7

Browse files
committed
Switch to centralized workflows
1 parent 1881494 commit 2be39d7

File tree

6 files changed

+31
-367
lines changed

6 files changed

+31
-367
lines changed

.github/workflows/ci.yml

Lines changed: 8 additions & 165 deletions
Original file line numberDiff line numberDiff line change
@@ -6,169 +6,12 @@ on:
66
- 'master'
77
- 'refs/heads/v[0-9]+.[0-9]+.[0-9]+'
88
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
914
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@v3
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@v3
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@v3
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@v2
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-
run: |
75-
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
76-
qa:
77-
name: Run ${{ matrix.check }} on PHP ${{ matrix.php }} with ${{ matrix.composer }} dependency preference
78-
strategy:
79-
fail-fast: false
80-
matrix:
81-
php: ${{ fromJson(needs.supported-versions-matrix.outputs.version) }}
82-
composer: [lowest, locked, highest]
83-
check: ${{ fromJson(needs.supported-checks-matrix.outputs.check) }}
84-
needs:
85-
- lint-yaml
86-
- lint-json
87-
- supported-checks-matrix
88-
- supported-versions-matrix
89-
runs-on: ubuntu-latest
90-
container:
91-
image: ghcr.io/wyrihaximusnet/php:${{ matrix.php }}-nts-buster-dev-root
92-
steps:
93-
- uses: actions/checkout@v3
94-
- uses: ramsey/composer-install@v2
95-
with:
96-
dependency-versions: ${{ matrix.composer }}
97-
- name: Fetch Tags
98-
run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* || true
99-
if: matrix.check == 'backward-compatibility-check'
100-
- run: make ${{ matrix.check }} || true
101-
if: needs.supported-versions-matrix.outputs.upcoming == matrix.php
102-
env:
103-
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
104-
COVERALLS_RUN_LOCALLY: ${{ secrets.COVERALLS_RUN_LOCALLY }}
105-
- run: make ${{ matrix.check }}
106-
if: needs.supported-versions-matrix.outputs.upcoming != matrix.php
107-
env:
108-
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
109-
COVERALLS_RUN_LOCALLY: ${{ secrets.COVERALLS_RUN_LOCALLY }}
110-
tests-directly-on-os:
111-
name: Run tests on PHP ${{ matrix.php }} with ${{ matrix.composer }} dependency preference (${{ matrix.os }})
112-
strategy:
113-
fail-fast: false
114-
matrix:
115-
os: [ubuntu-latest, windows-latest, macos-latest]
116-
php: ${{ fromJson(needs.supported-versions-matrix.outputs.version) }}
117-
composer: [lowest, locked, highest]
118-
needs:
119-
- lint-yaml
120-
- lint-json
121-
- supported-checks-matrix
122-
- supported-versions-matrix
123-
runs-on: ${{ matrix.os }}
124-
steps:
125-
- uses: actions/checkout@v3
126-
- uses: shivammathur/setup-php@v2
127-
with:
128-
php-version: ${{ matrix.php }}
129-
coverage: pcov
130-
extensions: intl, sodium
131-
- uses: ramsey/composer-install@v2
132-
with:
133-
dependency-versions: ${{ matrix.composer }}
134-
- run: |
135-
make unit-testing-raw
136-
env:
137-
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
138-
COVERALLS_RUN_LOCALLY: ${{ secrets.COVERALLS_RUN_LOCALLY }}
139-
lint-yaml:
140-
name: Lint YAML
141-
runs-on: ubuntu-latest
142-
steps:
143-
- uses: actions/checkout@v3
144-
- name: yaml-lint
145-
uses: ibiqlik/action-yamllint@v3
146-
with:
147-
config_data: |
148-
extends: default
149-
ignore: |
150-
/.git/
151-
rules:
152-
line-length: disable
153-
document-start: disable
154-
truthy: disable
155-
lint-json:
156-
name: Lint JSON
157-
runs-on: ubuntu-latest
158-
steps:
159-
- uses: actions/checkout@v3
160-
- name: json-syntax-check
161-
uses: limitusus/json-syntax-check@v1
162-
with:
163-
pattern: "\\.json$"
164-
check-mark:
165-
name: ✔️
166-
needs:
167-
- lint-yaml
168-
- lint-json
169-
- can-require
170-
- qa
171-
- tests-directly-on-os
172-
runs-on: ubuntu-latest
173-
steps:
174-
- run: echo "✔️"
15+
ci:
16+
name: Continuous Integration
17+
uses: WyriHaximus/github-workflows/.github/workflows/package.yaml@main

.github/workflows/composer-diff.yaml

Lines changed: 0 additions & 31 deletions
This file was deleted.

.github/workflows/craft-release.yaml

Lines changed: 0 additions & 55 deletions
This file was deleted.

.github/workflows/markdown-check-links.yaml

Lines changed: 0 additions & 14 deletions
This file was deleted.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Release Management
2+
on:
3+
pull_request:
4+
types:
5+
- opened
6+
- labeled
7+
- unlabeled
8+
- synchronize
9+
- reopened
10+
milestone:
11+
types:
12+
- closed
13+
permissions:
14+
contents: write
15+
issues: write
16+
pull-requests: write
17+
jobs:
18+
release-managment:
19+
name: Create Release
20+
uses: WyriHaximus/github-workflows/.github/workflows/package-release-managment.yaml@main
21+
with:
22+
milestone: ${{ github.event.milestone.title }}
23+
description: ${{ github.event.milestone.title }}

0 commit comments

Comments
 (0)