Skip to content

Commit be291d8

Browse files
committed
[TASK] Migrate CI to shared reusable workflows
1 parent 5bfadfd commit be291d8

File tree

10 files changed

+79
-125
lines changed

10 files changed

+79
-125
lines changed

.github/workflows/deploy-azure-assets.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
build:
1919
runs-on: ubuntu-latest
2020
steps:
21-
- uses: actions/checkout@v4
21+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
2222

2323
- name: Get the version
2424
id: get-version

.github/workflows/docker-test.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
runs-on: "ubuntu-latest"
2020
steps:
2121
- name: "Checkout"
22-
uses: "actions/checkout@v4"
22+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
2323

2424
- name: "Prepare action (adjust configure-guides-step)"
2525
##################################################################

.github/workflows/docker.yaml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
- linux/amd64
2121
- linux/arm64
2222
steps:
23-
- uses: actions/checkout@v4
23+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
2424

2525
- name: Prepare image name
2626
run: |
@@ -31,7 +31,7 @@ jobs:
3131

3232
- name: Docker meta
3333
id: meta
34-
uses: docker/metadata-action@v5
34+
uses: docker/metadata-action@030e881283bb7a6894de51c315a6bfe6a94e05cf
3535
with:
3636
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
3737
tags: |
@@ -42,24 +42,24 @@ jobs:
4242
type=semver,pattern={{major}}
4343
4444
- name: Log in to the Container registry
45-
uses: docker/login-action@v3
45+
uses: docker/login-action@b45d80f862d83dbcd57f89517bcf500b2ab88fb2
4646
with:
4747
registry: ${{ env.REGISTRY }}
4848
username: ${{ github.actor }}
4949
password: ${{ secrets.GITHUB_TOKEN }}
5050

5151
- name: Set up QEMU
52-
uses: docker/setup-qemu-action@v3
52+
uses: docker/setup-qemu-action@ce360397dd3f832beb865e1373c09c0e9f86d70a
5353

5454
- name: Set up Docker Buildx
5555
id: buildx
56-
uses: docker/setup-buildx-action@v3
56+
uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd
5757

5858
- name: Build and push
5959
id: build
6060
env:
6161
TYPO3AZUREEDGEURIVERSION: ${{ env.DOCKER_METADATA_OUTPUT_VERSION }}
62-
uses: docker/build-push-action@v6
62+
uses: docker/build-push-action@d08e5c354a6adb9ed34480a06d141179aa583294
6363
with:
6464
context: .
6565
push: ${{ github.event_name != 'pull_request' }}
@@ -77,7 +77,7 @@ jobs:
7777
touch "/tmp/digests/${digest#sha256:}"
7878
-
7979
name: Upload digest
80-
uses: actions/upload-artifact@v4
80+
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f
8181
with:
8282
name: digests-${{ env.PLATFORM_NAME }}
8383
overwrite: true
@@ -97,18 +97,18 @@ jobs:
9797
9898
-
9999
name: Download digests
100-
uses: actions/download-artifact@v4
100+
uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3
101101
with:
102102
pattern: digests-*
103103
merge-multiple: true
104104
path: /tmp/digests
105105
-
106106
name: Set up Docker Buildx
107-
uses: docker/setup-buildx-action@v2
107+
uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd
108108
-
109109
name: Docker meta
110110
id: meta
111-
uses: docker/metadata-action@v5
111+
uses: docker/metadata-action@030e881283bb7a6894de51c315a6bfe6a94e05cf
112112
with:
113113
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
114114
tags: |
@@ -118,7 +118,7 @@ jobs:
118118
type=raw,value=latest,enable=true
119119
120120
- name: Log in to the Container registry
121-
uses: docker/login-action@v3
121+
uses: docker/login-action@b45d80f862d83dbcd57f89517bcf500b2ab88fb2
122122
with:
123123
registry: ${{ env.REGISTRY }}
124124
username: ${{ github.actor }}

.github/workflows/main.yaml

Lines changed: 44 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -1,105 +1,56 @@
11
name: "Main"
22

3-
on: # yamllint disable-line rule:truthy
3+
on:
44
pull_request: null
55
push:
66
branches:
77
- "main"
88

9-
env:
10-
DEFAULT_PHP_VERSION: "8.1"
11-
RUN_ENVIRONMENT: "local"
9+
permissions: {}
1210

1311
jobs:
1412
tests:
15-
name : Tests
16-
runs-on: ubuntu-latest
17-
strategy:
18-
fail-fast: false
19-
matrix:
20-
php:
21-
- '8.1'
22-
- '8.2'
23-
- '8.3'
24-
- '8.4'
25-
- '8.5'
26-
steps:
27-
- name: Checkout
28-
uses: actions/checkout@v4
29-
30-
- name: "Install PHP"
31-
uses: "shivammathur/setup-php@v2"
32-
with:
33-
coverage: "none"
34-
php-version: "${{ matrix.php }}"
35-
extensions: 'inotify, pcntl'
36-
37-
- name: "Install dependencies with Composer"
38-
uses: "ramsey/composer-install@v2"
39-
with:
40-
dependency-versions: "locked"
41-
42-
- name: "Run unit tests"
43-
run: "make test-unit ENV=${{ env.RUN_ENVIRONMENT }}"
44-
45-
- name: "Run integration tests"
46-
run: "make test-integration ENV=${{ env.RUN_ENVIRONMENT }}"
13+
uses: TYPO3-Documentation/.github/.github/workflows/reusable-php-tests.yml@main
14+
with:
15+
php-versions: '["8.2", "8.3", "8.4", "8.5"]'
16+
test-unit-command: "make test-unit ENV=local"
17+
test-integration-command: "make test-integration ENV=local"
18+
php-extensions: "inotify, pcntl"
4719

4820
quality:
49-
name: Quality
50-
runs-on: ubuntu-latest
51-
steps:
52-
- name: Checkout
53-
uses: actions/checkout@v4
54-
55-
- name: "Install PHP"
56-
uses: "shivammathur/setup-php@v2"
57-
with:
58-
coverage: "none"
59-
php-version: "${{ env.DEFAULT_PHP_VERSION }}"
60-
extensions: 'inotify, pcntl'
61-
62-
- name: "Install dependencies with Composer"
63-
uses: "ramsey/composer-install@v2"
64-
with:
65-
dependency-versions: "locked"
66-
67-
- name: "Check for normalized composer.json"
68-
run: "composer normalize --dry-run"
69-
70-
- name: "CGL"
71-
run: "make code-style ENV=${{ env.RUN_ENVIRONMENT }}"
72-
73-
- name: "PHPSTAN"
74-
run: "make phpstan ENV=${{ env.RUN_ENVIRONMENT }}"
75-
76-
- name: "Lint guides.xml configurations"
77-
run: "make test-xml ENV=${{ env.RUN_ENVIRONMENT }}"
78-
79-
- name: "'Documentation' renders without warning'"
80-
run: "make test-docs ENV=${{ env.RUN_ENVIRONMENT }}"
81-
82-
- name: "'Documentation-rendertest' renders without warning'"
83-
run: "make test-rendertest ENV=${{ env.RUN_ENVIRONMENT }}"
84-
85-
monorepo-validate:
86-
name: "Validate monorepo structure"
87-
runs-on: "ubuntu-latest"
88-
steps:
89-
- name: "Checkout"
90-
uses: "actions/checkout@v4"
91-
92-
- name: "Install PHP"
93-
uses: "shivammathur/setup-php@v2"
94-
with:
95-
coverage: "none"
96-
php-version: "${{ env.DEFAULT_PHP_VERSION }}"
97-
extensions: 'inotify, pcntl'
98-
99-
- name: "Install dependencies with Composer"
100-
uses: "ramsey/composer-install@v2"
101-
with:
102-
dependency-versions: "locked"
103-
104-
- name: "Validate monorepo"
105-
run: "make test-monorepo ENV=${{ env.RUN_ENVIRONMENT }}"
21+
uses: TYPO3-Documentation/.github/.github/workflows/reusable-php-quality.yml@main
22+
with:
23+
php-version: "8.2"
24+
cs-fixer-command: "make code-style ENV=local"
25+
phpstan-command: "make phpstan ENV=local"
26+
run-xml-lint: true
27+
xml-lint-command: "make test-xml ENV=local"
28+
php-extensions: "inotify, pcntl"
29+
30+
composer-normalize:
31+
uses: TYPO3-Documentation/.github/.github/workflows/reusable-php-command.yml@main
32+
with:
33+
php-version: "8.2"
34+
command: "composer normalize --dry-run"
35+
php-extensions: "inotify, pcntl"
36+
37+
test-docs:
38+
uses: TYPO3-Documentation/.github/.github/workflows/reusable-php-command.yml@main
39+
with:
40+
php-version: "8.2"
41+
command: "make test-docs ENV=local"
42+
php-extensions: "inotify, pcntl"
43+
44+
test-rendertest:
45+
uses: TYPO3-Documentation/.github/.github/workflows/reusable-php-command.yml@main
46+
with:
47+
php-version: "8.2"
48+
command: "make test-rendertest ENV=local"
49+
php-extensions: "inotify, pcntl"
50+
51+
validate-monorepo:
52+
uses: TYPO3-Documentation/.github/.github/workflows/reusable-php-command.yml@main
53+
with:
54+
php-version: "8.2"
55+
command: "make test-monorepo ENV=local"
56+
php-extensions: "inotify, pcntl"

.github/workflows/pr-auto-approve.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
steps:
1919
- name: Dependabot metadata
2020
id: metadata
21-
uses: dependabot/fetch-metadata@v1
21+
uses: dependabot/fetch-metadata@d7267f607e9d3fb96fc2fbe83e0af444713e90b7
2222
with:
2323
github-token: "${{ secrets.GITHUB_TOKEN }}"
2424

.github/workflows/pr-auto-merge.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ on:
99
jobs:
1010
auto-merge:
1111
name: Dependabot auto-merge
12+
permissions:
13+
contents: write
1214

1315
runs-on: ubuntu-latest
1416

.github/workflows/split-repositories.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,22 +20,22 @@ jobs:
2020
runs-on: "ubuntu-latest"
2121
name: "Publish Sub-split"
2222
steps:
23-
- uses: "actions/checkout@v4"
23+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
2424
with:
2525
fetch-depth: "0"
2626
persist-credentials: "false"
27-
- uses: "frankdejonge/use-github-token@1.0.2"
27+
- uses: frankdejonge/use-github-token@15e6289d07c12b3b1603268a628bb74f2e9765f4
2828
with:
2929
authentication: "typo3-documentation-team:${{ secrets.BOT_TOKEN }}"
3030
user_name: "TYPO3 Documentation Team"
3131
user_email: "documentation-automation@typo3.com"
3232
- name: "Cache splitsh-lite"
3333
id: "splitsh-cache"
34-
uses: "actions/cache@v4"
34+
uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306
3535
with:
3636
path: "./.splitsh"
3737
key: "${{ runner.os }}-splitsh-d-101"
38-
- uses: "frankdejonge/use-subsplit-publish@1.0.0"
38+
- uses: frankdejonge/use-subsplit-publish@0001015147267203898034927e8cccad3a7a9aa7
3939
with:
4040
source-branch: "main"
4141
config-path: "./config.subsplit-publish.json"

composer.lock

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/typo3-docs-theme/package-lock.json

Lines changed: 10 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/typo3-docs-theme/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"grunt-exec": "^3.0.0",
2222
"grunt-sass": "^4.1.0",
2323
"grunt-stylelint": "^0.20.1",
24-
"sass": "^1.97.3",
24+
"sass": "^1.98.0",
2525
"stylelint": "^16.26.1",
2626
"vite": "^7.3.1"
2727
},

0 commit comments

Comments
 (0)