Merge pull request #503 from commercetools/gen-sdk-updates #3760
Workflow file for this run
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
on: | |
- push | |
- workflow_dispatch | |
- pull_request | |
name: CI | |
# Declare default permissions as read only. | |
permissions: read-all | |
jobs: | |
integrationTest: | |
name: Integration tests | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write # for stefanzweifel/git-auto-commit-action to push code in repo | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- uses: gradle/wrapper-validation-action@56b90f209b02bf6d1deae490e9ef18b21a389cd4 | |
- name: Setup Java | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'temurin' | |
java-version: '17' | |
- name: Setup Graphviz | |
uses: ts-graphviz/setup-graphviz@c001ccfb5aff62e28bda6a6c39b59a7e061be5b9 | |
- name: Fix code style | |
if: github.event_name == 'push' && github.ref != 'refs/heads/main' | |
run: ./gradlew spotlessApply | |
- uses: stefanzweifel/git-auto-commit-action@3d1b5e078a85df99db0cb2441cd4309b09d86253 | |
if: github.event_name == 'push' && github.ref != 'refs/heads/main' | |
with: | |
commit_message: "spotless: Fix code style" | |
commit_user_name: automation-commercetools | |
commit_user_email: automation@commercetools.com | |
commit_author: Auto Mation <automation@commercetools.com> | |
- name: "Run if style changes have been detected" | |
if: steps.auto-commit-action.outputs.changes_detected == 'true' | |
run: echo "${{steps.auto-commit-action.outputs.commit_hash}}" >> .git-blame-ignore-revs | |
- uses: stefanzweifel/git-auto-commit-action@3d1b5e078a85df99db0cb2441cd4309b09d86253 | |
if: github.event_name == 'push' && github.ref != 'refs/heads/main' | |
with: | |
file_pattern: '.git-blame-ignore-revs' | |
commit_message: "spotless: add commit to blame ignore revs file" | |
commit_user_name: automation-commercetools | |
commit_user_email: automation@commercetools.com | |
commit_author: Auto Mation <automation@commercetools.com> | |
- name: License check | |
run: ./gradlew checkLicense | |
- uses: stefanzweifel/git-auto-commit-action@3d1b5e078a85df99db0cb2441cd4309b09d86253 | |
if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
with: | |
file_pattern: 'licenses/index.json licenses/**/index.json' | |
commit_message: "TASK: Updating license information" | |
commit_user_name: automation-commercetools | |
commit_user_email: automation@commercetools.com | |
commit_author: Auto Mation <automation@commercetools.com> | |
disable_globbing: true | |
- name: Run integration tests for PR | |
if: github.event_name == 'pull_request' | |
run: ./gradlew clean build publishMavenPublicationToMavenLocal runMainMethodThreadLeakTest runMainMethodMemoryLeakTest | |
env: | |
CTP_CLIENT_ID: ${{ secrets.CTP_CLIENT_ID_PR }} | |
CTP_CLIENT_SECRET: ${{ secrets.CTP_CLIENT_SECRET_PR }} | |
CTP_PROJECT_KEY: ${{ secrets.CTP_PROJECT_KEY_PR }} | |
SOURCE_TAG: ${{ github.ref_name }} | |
CTP_JVM_SDK_LOG_LEVEL: OFF | |
- name: Run integration tests | |
if: github.event_name != 'pull_request' | |
run: ./gradlew clean build publishMavenPublicationToMavenLocal runMainMethodThreadLeakTest runMainMethodMemoryLeakTest | |
env: | |
CTP_CLIENT_ID: ${{ secrets.CTP_CLIENT_ID }} | |
CTP_CLIENT_SECRET: ${{ secrets.CTP_CLIENT_SECRET }} | |
CTP_PROJECT_KEY: ${{ secrets.CTP_PROJECT_KEY }} | |
SOURCE_TAG: ${{ github.ref_name }} | |
CTP_JVM_SDK_LOG_LEVEL: OFF | |
- name: Test examples | |
run: | | |
cd examples/maven-okhttp3 && mvn verify --no-transfer-progress | |
cd ../maven-okhttp4 && mvn verify --no-transfer-progress | |
- name: Collect code coverage | |
run: ./gradlew codeCoverageReport | |
- name: Send code coverage report to Codecov.io | |
run: bash <(curl -s https://codecov.io/bash) || true | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
docs: | |
name: Docs test build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- uses: gradle/wrapper-validation-action@56b90f209b02bf6d1deae490e9ef18b21a389cd4 | |
- name: Setup Java | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'temurin' | |
java-version: '17' | |
- name: Setup Graphviz | |
uses: ts-graphviz/setup-graphviz@c001ccfb5aff62e28bda6a6c39b59a7e061be5b9 | |
- name: build javadoc | |
if: github.event_name == 'workflow_dispatch' || github.event_name == 'push' && github.ref == 'refs/heads/main' | |
run: ./gradlew alljavadoc |