|
6 | 6 | merge_group:
|
7 | 7 |
|
8 | 8 | jobs:
|
9 |
| - diff-check: |
10 |
| - name: Diff check |
11 |
| - runs-on: ubuntu-latest |
12 |
| - |
13 |
| - steps: |
14 |
| - # Setup |
15 |
| - - uses: actions/checkout@v4 |
16 |
| - with: |
17 |
| - submodules: recursive |
18 |
| - - name: Update submodules |
19 |
| - run: git submodule update --remote --recursive |
20 |
| - - uses: actions/setup-node@v4 |
21 |
| - id: setup_node_id |
22 |
| - with: |
23 |
| - node-version: 18 |
24 |
| - - uses: shivammathur/setup-php@v2 |
25 |
| - with: |
26 |
| - php-version: 8.2 |
27 |
| - |
28 |
| - # Install openapi-generator-cli |
29 |
| - - run: echo "OPENAPI_GENERATOR_VERSION=6.6.0" >> $GITHUB_ENV |
30 |
| - - uses: actions/cache@v4 |
31 |
| - id: openapi-generator-cache |
32 |
| - env: |
33 |
| - cache-name: openapi-generator-cache |
34 |
| - with: |
35 |
| - path: ~/bin/openapitools |
36 |
| - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.OPENAPI_GENERATOR_VERSION }} |
37 |
| - - if: steps.openapi-generator-cache.outputs.cache-hit != 'true' |
38 |
| - run: | |
39 |
| - mkdir -p ~/bin/openapitools |
40 |
| - curl https://raw.githubusercontent.com/OpenAPITools/openapi-generator/master/bin/utils/openapi-generator-cli.sh > ~/bin/openapitools/openapi-generator-cli |
41 |
| - chmod u+x ~/bin/openapitools/openapi-generator-cli |
42 |
| - export PATH=$PATH:~/bin/openapitools/ |
43 |
| - OPENAPI_GENERATOR_VERSION=${{ env.OPENAPI_GENERATOR_VERSION }} openapi-generator-cli version |
44 |
| -
|
45 |
| - - name: Generate codes |
46 |
| - run: | |
47 |
| - export PATH=$PATH:~/bin/openapitools/ |
48 |
| - bash tools/gen-oas-client.sh |
49 |
| - - name: Update document |
50 |
| - run: | |
51 |
| - wget https://github.com/phpDocumentor/phpDocumentor/releases/download/v3.3.1/phpDocumentor.phar |
52 |
| - php phpDocumentor.phar run -d src -t docs |
53 |
| - - run: | |
54 |
| - diff=$(git --no-pager diff --name-only HEAD) |
55 |
| - echo "DIFF_IS_EMPTY=$([[ -z "$diff" ]] && echo 'true' || echo 'false')" >> $GITHUB_ENV |
56 |
| - echo "CURRENT_DATETIME=$(date +'%Y%m%d%H%M%S')" >> $GITHUB_ENV |
57 |
| - - if: ${{ env.DIFF_IS_EMPTY != 'true' && github.actor != 'renovate[bot]' }} |
58 |
| - run: | |
59 |
| - echo "There are changes from the auto-generated files by OAS. Please run diff-check.yml and merge the PR generated by it first." |
60 |
| - echo "The files with differences are as follows." |
61 |
| - echo "$(git --no-pager diff --name-only HEAD)" |
62 |
| - exit 1 |
63 | 9 | tests:
|
64 | 10 | name: Run checks on PHP ${{ matrix.php }}
|
65 | 11 | runs-on: ubuntu-latest
|
|
0 commit comments