Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate code at first, then run test to detect CI failure easily #521

Merged
merged 5 commits into from
Oct 11, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 25 additions & 2 deletions .github/workflows/php-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,35 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4

with:
submodules: recursive
- name: Set up PHP ${{ matrix.php }}
uses: shivammathur/setup-php@v2
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 +62,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