Skip to content

Merge pull request #97 from criteo/update-oas-2024-04-04 #136

Merge pull request #97 from criteo/update-oas-2024-04-04

Merge pull request #97 from criteo/update-oas-2024-04-04 #136

name: Generate Python 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: Setup SSH Agent for git operations
uses: webfactory/ssh-agent@v0.5.4
with:
ssh-private-key: ${{ secrets.PYTHON_SDK_REPO_PRIVATE_KEY }}
- name: Generate SDKs
run: ./gradlew :generator:python:generateClient
shell: bash
- name: Test SDKs
run: python ./scripts/test_sdk.py --language python
shell: bash
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 }}
- name: Upload Sdk
uses: actions/upload-artifact@v2
with:
name: generated-sources-python
path: ./generated-sources/python
- name: Push python SDK
run: python ./scripts/push_sdk.py --language python
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: Python 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: Python 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