Merge pull request #94 from criteo/update-oas-2024-02-07 #188
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Generate PHP Sources | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- 'api-specifications/**' | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Make gradlew executable | |
run: chmod +x ./gradlew | |
- name: Set up JDK 1.8 | |
uses: actions/setup-java@v1 | |
with: | |
java-version: 1.8 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.9' | |
- name: Set up PHP Composer | |
uses: php-actions/composer@v6 | |
with: | |
version: 2 | |
php_version: 8.0 | |
command: about | |
- uses: webfactory/[email protected] | |
with: | |
ssh-private-key: | | |
${{ secrets.PHP_SDK_REPO_PRIVATE_KEY_MS }} | |
${{ secrets.PHP_SDK_REPO_PRIVATE_KEY_RM }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install GitPython | |
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | |
- name: Generate SDKs | |
run: ./gradlew :generator:php:generateClient | |
shell: bash | |
- name: Test SDKs | |
run: python ./scripts/test_sdk.py --language php | |
env: | |
TEST_CLIENT_ID: ${{ secrets.SDK_TEST_CLIENT_ID }} | |
TEST_CLIENT_SECRET: ${{ secrets.SDK_TEST_CLIENT_SECRET }} | |
TEST_APPLICATION_ID: ${{ secrets.SDK_TEST_APPLICATION_ID }} | |
shell: bash | |
- name: Upload SDKs | |
uses: actions/upload-artifact@v2 | |
with: | |
name: generated-sources-php | |
path: ./generated-sources/php | |
- name: Push SDKs | |
run: python ./scripts/push_sdk.py --language php | |
shell: bash | |
- name: Send success notification | |
uses: rtCamp/action-slack-notify@v2 | |
env: | |
SLACK_CHANNEL: criteo-api-sdk-generator | |
SLACK_COLOR: ${{ job.status }} | |
SLACK_MESSAGE: PHP build succeeded. <https://github.com/criteo/criteo-api-sdk-generator/actions/runs/${{github.run_id}}|Link to build> | |
SLACK_USERNAME: sdk-generation-bot | |
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} | |
SLACK_FOOTER: '' | |
SLACK_ICON_EMOJI: green_check_mark | |
- name: Send failure notification | |
if: ${{ failure() }} | |
uses: rtCamp/action-slack-notify@v2 | |
env: | |
SLACK_CHANNEL: criteo-api-sdk-generator | |
SLACK_COLOR: ${{ job.status }} | |
SLACK_MESSAGE: PHP build failed. <https://github.com/criteo/criteo-api-sdk-generator/actions/runs/${{github.run_id}}|Link to build> | |
SLACK_USERNAME: sdk-generation-bot | |
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} | |
SLACK_FOOTER: '' | |
SLACK_ICON_EMOJI: x |