|
| 1 | +name: java-server-sdk-redis-store |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [main, 'feat/**'] |
| 6 | + paths-ignore: |
| 7 | + - '**.md' #Do not need to run CI for markdown changes. |
| 8 | + pull_request: |
| 9 | + branches: [main, 'feat/**'] |
| 10 | + paths-ignore: |
| 11 | + - '**.md' |
| 12 | + |
| 13 | +jobs: |
| 14 | + build-test-java-server-sdk-redis-store: |
| 15 | + strategy: |
| 16 | + matrix: |
| 17 | + jedis-version: [2.9.0, 3.0.0] |
| 18 | + runs-on: ubuntu-latest |
| 19 | + steps: |
| 20 | + - uses: actions/checkout@v3 |
| 21 | + |
| 22 | + - name: Edit build.gradle to change Jedis version |
| 23 | + shell: bash |
| 24 | + run: | |
| 25 | + cd lib/java-server-sdk-redis-store |
| 26 | + sed -i.bak 's#"jedis":.*"[0-9.]*"#"jedis":"${{ matrix.jedis-version }}"#' build.gradle |
| 27 | +
|
| 28 | + - name: Shared CI Steps |
| 29 | + uses: ./.github/actions/ci |
| 30 | + with: |
| 31 | + workspace_path: 'lib/java-server-sdk-redis-store' |
| 32 | + java_version: 8 |
| 33 | + |
| 34 | + build-test-java-server-sdk-windows: |
| 35 | + strategy: |
| 36 | + matrix: |
| 37 | + jedis-version: [2.9.0, 3.0.0] |
| 38 | + runs-on: windows-latest |
| 39 | + steps: |
| 40 | + - uses: actions/checkout@v3 |
| 41 | + |
| 42 | + - run: | |
| 43 | + $ProgressPreference = "SilentlyContinue" |
| 44 | + iwr -outf redis.zip https://github.com/MicrosoftArchive/redis/releases/download/win-3.0.504/Redis-x64-3.0.504.zip |
| 45 | + mkdir redis |
| 46 | + Expand-Archive -Path redis.zip -DestinationPath redis |
| 47 | + cd redis |
| 48 | + .\redis-server --service-install |
| 49 | + .\redis-server --service-start |
| 50 | + Start-Sleep -s 5 |
| 51 | + .\redis-cli ping |
| 52 | +
|
| 53 | + - name: Edit build.gradle to change Jedis version |
| 54 | + shell: bash |
| 55 | + run: | |
| 56 | + cd lib/java-server-sdk-redis-store |
| 57 | + sed -i.bak 's#"jedis":.*"[0-9.]*"#"jedis":"${{ matrix.jedis-version }}"#' build.gradle |
| 58 | +
|
| 59 | + - name: Setup Java |
| 60 | + uses: actions/setup-java@v4 |
| 61 | + with: |
| 62 | + distribution: 'temurin' |
| 63 | + java-version: 8 |
| 64 | + |
| 65 | + - name: Restore dependencies |
| 66 | + shell: bash |
| 67 | + id: restore |
| 68 | + run: lib/java-server-sdk-redis-store/gradlew dependencies -p lib/java-server-sdk-redis-store |
| 69 | + |
| 70 | + - name: Build |
| 71 | + shell: bash |
| 72 | + id: build |
| 73 | + run: lib/java-server-sdk-redis-store/gradlew build -p lib/java-server-sdk-redis-store |
| 74 | + |
| 75 | + - name: Build Jar |
| 76 | + shell: bash |
| 77 | + id: buildjar |
| 78 | + run: lib/java-server-sdk-redis-store/gradlew jar -p lib/java-server-sdk-redis-store |
| 79 | + |
| 80 | + - name: Run Tests |
| 81 | + if: steps.build.outcome == 'success' && inputs.run_tests == 'true' |
| 82 | + shell: bash |
| 83 | + run: lib/java-server-sdk-redis-store/gradlew test -p lib/java-server-sdk-redis-store |
| 84 | + |
| 85 | + - name: Build Documentation |
| 86 | + shell: bash |
| 87 | + run: lib/java-server-sdk-redis-store/gradlew javadoc -p lib/java-server-sdk-redis-store |
0 commit comments