Benchmark: Add json config files and support custom json config as CI… #269
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: CI | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - release-* | |
| pull_request: | |
| branches: | |
| - main | |
| - release-* | |
| workflow_dispatch: | |
| jobs: | |
| generate-test-matrices: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| full-matrix: ${{ steps.set-full-matrix.outputs.full-matrix }} | |
| jdk-matrix: ${{ steps.set-jdk-matrix.outputs.jdk-matrix }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Read and expand full tests-matrix.json | |
| id: set-full-matrix | |
| run: | | |
| jq -n ' | |
| [inputs[] | | |
| .["openjdk-versions"][] as $jdk | | |
| ( | |
| ["redis", "valkey"][] as $engine | | |
| ( | |
| if $engine == "redis" then .["redis-versions"] else .["valkey-versions"] end | |
| )[] as $version | | |
| { | |
| jdk: $jdk, | |
| engine: $engine, | |
| version: $version | |
| } | |
| ) | |
| ] | |
| ' .github/workflows/tests-matrix.json > tests-matrix-expanded.json | |
| echo "full-matrix=$(cat tests-matrix-expanded.json | jq -c .)" >> $GITHUB_OUTPUT | |
| - name: Extract JDK versions only | |
| id: set-jdk-matrix | |
| run: | | |
| jq -n ' | |
| [inputs[].["openjdk-versions"][] | { jdk: . }] | |
| ' .github/workflows/tests-matrix.json > jdk-matrix-expanded.json | |
| echo "jdk-matrix=$(cat jdk-matrix-expanded.json | jq -c .)" >> $GITHUB_OUTPUT | |
| ci-baseline-tests: | |
| needs: generate-test-matrices | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: ${{ fromJson(needs.generate-test-matrices.outputs.full-matrix) }} | |
| name: Baseline test with JDK ${{ matrix.jdk }} and ${{ matrix.engine }} ${{ matrix.version }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up JDK | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: ${{ matrix.jdk }} | |
| distribution: "temurin" | |
| - name: Cache Maven dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.m2/spring-data-valkey | |
| key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-maven- | |
| - name: Start engine | |
| run: | | |
| make start PROJECT=${{ matrix.engine }} VERSION=${{ matrix.version }} GH_ORG=${{ matrix.engine == 'redis' && 'redis' || 'valkey-io' }} | |
| - name: Test Spring Data Valkey | |
| run: | | |
| ./mvnw -s settings.xml \ | |
| -Ddevelocity.storage.directory=$HOME/.develocity-root \ | |
| -Dmaven.repo.local=$HOME/.m2/spring-data-valkey \ | |
| test -Pnone \ | |
| -pl spring-data-valkey \ | |
| -DrunLongTests=true \ | |
| -Dvalkey.server.version=${{ matrix.version }} \ | |
| -U -B | |
| - name: Install Spring Data Valkey | |
| run: | | |
| ./mvnw -s settings.xml \ | |
| -Ddevelocity.storage.directory=$HOME/.develocity-root \ | |
| -Dmaven.repo.local=$HOME/.m2/spring-data-valkey \ | |
| install -DskipTests \ | |
| -pl spring-data-valkey -am \ | |
| -Dgpg.skip=true \ | |
| -B | |
| - name: Test Spring Boot Starter | |
| run: | | |
| ./mvnw -s settings.xml \ | |
| -Ddevelocity.storage.directory=$HOME/.develocity-root \ | |
| -Dmaven.repo.local=$HOME/.m2/spring-data-valkey \ | |
| test \ | |
| -pl spring-boot-starter-data-valkey \ | |
| -U -B | |
| ci-runtimehints-tests: | |
| needs: generate-test-matrices | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: ${{ fromJson(needs.generate-test-matrices.outputs.jdk-matrix) }} | |
| name: Runtime hints tests with JDK ${{ matrix.jdk }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up JDK | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: ${{ matrix.jdk }} | |
| distribution: "temurin" | |
| - name: Cache Maven dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.m2/spring-data-valkey | |
| key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-maven- | |
| # Runtime hints tests still need an engine, but can use a single version | |
| # Use oldest valkey version for runtime hints tests | |
| - name: Start Valkey | |
| run: | | |
| make start PROJECT=valkey VERSION=8.0.3 GH_ORG=valkey-io | |
| - name: Test runtimehints | |
| run: | | |
| ./mvnw -s settings.xml \ | |
| -Ddevelocity.storage.directory=$HOME/.develocity-root \ | |
| -Dmaven.repo.local=$HOME/.m2/spring-data-valkey \ | |
| test -Pruntimehints \ | |
| -DrunLongTests=false \ | |
| -pl spring-data-valkey \ | |
| -U -B |