Skip to content

Commit

Permalink
Generate code at first, then run test to detect CI failure easily
Browse files Browse the repository at this point in the history
  • Loading branch information
Yang-33 committed Oct 10, 2023
1 parent 275ba03 commit e099f55
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion .github/workflows/php-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,28 @@ jobs:
with:
php-version: ${{ matrix.php }}

- name: Install openapi-generator-cli
run: echo "OPENAPI_GENERATOR_VERSION=6.6.0" >> $GITHUB_ENV
- uses: actions/cache@v3
id: openapi-generator-cache
env:
cache-name: openapi-generator-cache
with:
path: ~/bin/openapitools
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.OPENAPI_GENERATOR_VERSION }}
- if: steps.openapi-generator-cache.outputs.cache-hit != 'true'
run: |
mkdir -p ~/bin/openapitools
curl https://raw.githubusercontent.com/OpenAPITools/openapi-generator/master/bin/utils/openapi-generator-cli.sh > ~/bin/openapitools/openapi-generator-cli
chmod u+x ~/bin/openapitools/openapi-generator-cli
export PATH=$PATH:~/bin/openapitools/
OPENAPI_GENERATOR_VERSION=${{ env.OPENAPI_GENERATOR_VERSION }} openapi-generator-cli version
- name: Generate code
run: |
export PATH=$PATH:~/bin/openapitools/
bash tools/gen-oas-client.sh
- name: Get Composer Cache Directory
id: composer-cache
run: |
Expand All @@ -39,7 +61,7 @@ jobs:
- name: Install dependencies with Composer
uses: ramsey/composer-install@v2

- name: Check copyrights
if: matrix.analysis
run: bash tools/check_copyright.sh
Expand Down

0 comments on commit e099f55

Please sign in to comment.