Skip to content

ci: Test upper bound dependenices file in Github CI #13

ci: Test upper bound dependenices file in Github CI

ci: Test upper bound dependenices file in Github CI #13

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
- run: echo "DEPENDENCIES_LIST=${{ github.event.inputs.dependencies-list }}" >> $GITHUB_ENV
# 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
shell: bash
run: |
if [[ -z ${{ env.DEPENDENCIES_LIST }} ]]
./.github/scripts/test_dependency_compatibility.sh -f dependencies.txt
else
./.github/scripts/test_dependency_compatibility.sh -l ${{ env.DEPENDENCIES_LIST }}
fi
# 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)
shell: bash
run: |
if [[ -z ${{ env.DEPENDENCIES_LIST }} ]]
../.github/scripts/test_dependency_compatibility.sh -f ../dependencies.txt
else
../.github/scripts/test_dependency_compatibility.sh -l ${{ env.DEPENDENCIES_LIST }}
fi
working-directory: java-showcase