Skip to content

Commit 7a19e9c

Browse files
committed
Check generated files are up-to-date
1 parent 4e66bbc commit 7a19e9c

File tree

2 files changed

+46
-0
lines changed

2 files changed

+46
-0
lines changed

.github/actions/setup/action.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ inputs:
1111
description: "INI values to pass along to setup-php action"
1212
required: false
1313
default: ""
14+
working-directory:
15+
description: "The directory where composer.json is located, if it is not in the repository root."
16+
required: false
1417

1518
runs:
1619
using: composite
@@ -49,3 +52,4 @@ runs:
4952
# Revert when psalm supports PHP 8.4
5053
# composer-options: "--no-suggest"
5154
composer-options: "--no-suggest ${{ inputs.php-version == '8.4' && '--ignore-platform-req=php+' || '' }}"
55+
working-directory: "${{ inputs.working-directory }}"

.github/workflows/generator.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: "Generator"
2+
3+
on:
4+
merge_group:
5+
pull_request:
6+
branches:
7+
- "v*.*"
8+
- "master"
9+
- "feature/*"
10+
push:
11+
branches:
12+
- "v*.*"
13+
- "master"
14+
- "feature/*"
15+
16+
env:
17+
PHP_VERSION: "8.2"
18+
# TODO: change to "stable" once 1.20.0 is released
19+
# DRIVER_VERSION: "stable"
20+
DRIVER_VERSION: "mongodb/mongo-php-driver@v1.20"
21+
22+
jobs:
23+
psalm:
24+
name: "Diff check"
25+
runs-on: "ubuntu-22.04"
26+
27+
steps:
28+
- name: "Checkout"
29+
uses: "actions/checkout@v4"
30+
31+
- name: "Setup"
32+
uses: "./.github/actions/setup"
33+
with:
34+
php-version: ${{ env.PHP_VERSION }}
35+
driver-version: ${{ env.DRIVER_VERSION }}
36+
working-directory: "generator"
37+
38+
- name: "Run Generator"
39+
run: "generator/generate"
40+
41+
- name: "Check file diff"
42+
run: git add . -N && git diff --exit-code

0 commit comments

Comments
 (0)