Delegate authentication scheme to Authenticator interface #534
Workflow file for this run
This file contains hidden or 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: Pipeline | |
| on: | |
| pull_request: | |
| branches: | |
| - main | |
| paths-ignore: | |
| - '.gitignore' | |
| - 'CODEOWNERS' | |
| - 'LICENSE' | |
| - '*.txt' | |
| - '.all-contributorsrc' | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| verify-license-and-format: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Set up Java and Maven | |
| uses: actions/setup-java@v5 | |
| with: | |
| distribution: "temurin" | |
| java-version: "17" | |
| cache: "maven" | |
| - name: Check License and Code Formatting | |
| run: | | |
| if ./mvnw initialize license:check formatter:validate; then | |
| echo "Checks passed!" | |
| else | |
| echo "::error ::License or formatting check failed." | |
| echo "::error ::Please run 'mvn compile' to fix the issues before committing." | |
| exit 1 | |
| fi | |
| junit-test: | |
| needs: verify-license-and-format | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| java: [17, 21, 25] | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Setup JDK ${{ matrix.java }} | |
| uses: actions/setup-java@v5 | |
| with: | |
| distribution: temurin | |
| java-version: ${{ matrix.java }} | |
| cache: maven | |
| - name: Run tests | |
| run: ./mvnw verify -B -ntp | |
| detect-release: | |
| runs-on: ubuntu-latest | |
| needs: verify-license-and-format | |
| outputs: | |
| changed: ${{ steps.detect.outputs.changed }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Detect version change | |
| id: detect | |
| run: | | |
| if git diff --name-only origin/main...HEAD | grep -q ".github/project.yml"; then | |
| echo "changed=true" >> $GITHUB_OUTPUT | |
| else | |
| echo "changed=false" >> $GITHUB_OUTPUT | |
| fi | |
| build-samples: | |
| runs-on: ubuntu-latest | |
| needs: | |
| - verify-license-and-format | |
| - detect-release | |
| if: needs.detect-release.outputs.changed == 'true' | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Set up Java and Maven | |
| uses: actions/setup-java@v5 | |
| with: | |
| distribution: "temurin" | |
| java-version: "17" | |
| cache: "maven" | |
| - name: Extract next version from project.yml | |
| run: | | |
| next=$(grep 'next-version:' .github/project.yml | awk '{print $2}' | tr -d '"') | |
| echo "NEXT_VERSION=$next" >> $GITHUB_ENV | |
| - name: Update samples pom.xml to ${{env.NEXT_VERSION}} | |
| run: ./mvnw -f samples/pom.xml versions:use-dep-version -Dincludes=com.ibm.watsonx:watsonx-ai -DdepVersion=${{env.NEXT_VERSION}} -DforceVersion=true | |
| - name: Build and Install ${{env.NEXT_VERSION}} version | |
| run: ./mvnw clean install -B -ntp -DskipTests -Dmaven.test.skip=true | |
| - name: Build samples | |
| run: ./mvnw -f samples/pom.xml clean package -B -ntp | |
| run-integration-tests: | |
| runs-on: ubuntu-latest | |
| needs: | |
| - junit-test | |
| - build-samples | |
| - detect-release | |
| if: needs.detect-release.outputs.changed == 'true' | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Setup JDK 17 | |
| uses: actions/setup-java@v5 | |
| with: | |
| distribution: temurin | |
| java-version: 17 | |
| cache: maven | |
| - name: Run Integration Tests | |
| run: ./mvnw verify -Pintegration-tests -B -ntp |