ci: Test upper bound dependenices file in Github CI #9
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: Dependency Compatibility Test | |
| on: | |
| pull_request: | |
| branches: | |
| - 'main' | |
| workflow_dispatch: | |
| inputs: | |
| dependencies-list: | |
| description: 'Comma-separated list of dependencies to test (Format: dep1=1.0,dep2=2.0)' | |
| required: false | |
| default: '' | |
| schedule: | |
| - cron: '0 1 * * *' # Nightly at 1am | |
| jobs: | |
| dependency-compatibility-test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout sdk-platform-java | |
| uses: actions/checkout@v4 | |
| - name: Set up JDK 21 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '21' | |
| distribution: 'temurin' | |
| cache: maven | |
| # Set up the for the CI | |
| - name: Install sdk-platform-java's modules | |
| # gapic-generator-java requires Java 8 and is irrelevant for this CI | |
| run: mvn -q -B -ntp install --projects '!gapic-generator-java' -Dcheckstyle.skip -Dfmt.skip -DskipTests -Dclirr.skip -T 1C | |
| # Run in the root module which should test for everything barring showcase | |
| - name: Perform Dependency Compatibility Testing | |
| # Unless specifically inputted by the user, the `-l` argument will be empty | |
| # and the workflow will run with the default upper-bounds dependencies file | |
| run: ./.github/scripts/test_dependency_compatibility.sh -f dependencies.txt -l ${{ github.event.inputs.dependencies-list }} | |
| # Set up local showcase server | |
| - name: Parse showcase version | |
| working-directory: java-showcase/gapic-showcase | |
| run: echo "SHOWCASE_VERSION=$(mvn help:evaluate -Dexpression=gapic-showcase.version -q -DforceStdout)" >> "$GITHUB_ENV" | |
| - name: Install showcase server | |
| run: | | |
| sudo mkdir -p /usr/src/showcase | |
| sudo chown -R ${USER} /usr/src/ | |
| curl --location https://github.com/googleapis/gapic-showcase/releases/download/v${{env.SHOWCASE_VERSION}}/gapic-showcase-${{env.SHOWCASE_VERSION}}-linux-amd64.tar.gz --output /usr/src/showcase/showcase-${{env.SHOWCASE_VERSION}}-linux-amd64.tar.gz | |
| cd /usr/src/showcase/ | |
| tar -xf showcase-* | |
| ./gapic-showcase run & | |
| cd - | |
| # Run for the Showcase tests | |
| - name: Perform Dependency Compatibility Testing (Showcase) | |
| # Unless specifically inputted by the user, the `-l` argument will be empty | |
| # and the workflow will run with the default upper-bounds dependencies file | |
| run: ../.github/scripts/test_dependency_compatibility.sh -f ../dependencies.txt -l ${{ github.event.inputs.dependencies-list }} | |
| working-directory: java-showcase |