|
| 1 | +# Archived CircleCI configuration kept for reference after migration to GitHub Actions. |
| 2 | +# Active CI lives under .github/workflows/. |
| 3 | +# |
| 4 | +# Java Gradle CircleCI 2.0 configuration file |
| 5 | +# |
| 6 | +# Check https://circleci.com/docs/2.0/language-java/ for more details |
| 7 | +# |
| 8 | +version: 2.1 |
| 9 | + |
| 10 | +aliases: |
| 11 | + attach_workspace: &attach_workspace |
| 12 | + attach_workspace: |
| 13 | + at: . |
| 14 | + |
| 15 | + environment: &environment |
| 16 | + environment: |
| 17 | + RQUEUE_REACTIVE_ENABLED: "false" |
| 18 | + |
| 19 | + reactive_environment: &reactive_environment |
| 20 | + environment: |
| 21 | + RQUEUE_REACTIVE_ENABLED: "true" |
| 22 | + |
| 23 | + |
| 24 | + persist_to_workspace: &persist_to_workspace |
| 25 | + persist_to_workspace: |
| 26 | + root: . |
| 27 | + paths: |
| 28 | + - . |
| 29 | + |
| 30 | + redis_dep: &redis_dep |
| 31 | + run: |
| 32 | + name: Install Dependencies |
| 33 | + command: | |
| 34 | + sudo apt -y install redis-server |
| 35 | + redis-cli --version |
| 36 | +
|
| 37 | + redis_cluster_setup: &redis_cluster_setup |
| 38 | + run: |
| 39 | + name: Setup Redis Cluster |
| 40 | + background: true |
| 41 | + command: | |
| 42 | + mkdir 9000 9001 9002 9003 9004 9005 |
| 43 | + printf "port 9000 \ncluster-enabled yes \ncluster-config-file nodes.conf \ncluster-node-timeout 5000 \nappendonly yes" >> 9000/redis.conf |
| 44 | + printf "port 9001 \ncluster-enabled yes \ncluster-config-file nodes.conf \ncluster-node-timeout 5000 \nappendonly yes" >> 9001/redis.conf |
| 45 | + printf "port 9002 \ncluster-enabled yes \ncluster-config-file nodes.conf \ncluster-node-timeout 5000 \nappendonly yes" >> 9002/redis.conf |
| 46 | + printf "port 9003 \ncluster-enabled yes \ncluster-config-file nodes.conf \ncluster-node-timeout 5000 \nappendonly yes" >> 9003/redis.conf |
| 47 | + printf "port 9004 \ncluster-enabled yes \ncluster-config-file nodes.conf \ncluster-node-timeout 5000 \nappendonly yes" >> 9004/redis.conf |
| 48 | + printf "port 9005 \ncluster-enabled yes \ncluster-config-file nodes.conf \ncluster-node-timeout 5000 \nappendonly yes" >> 9005/redis.conf |
| 49 | + cd 9000 && redis-server ./redis.conf & |
| 50 | + cd 9001 && redis-server ./redis.conf & |
| 51 | + cd 9002 && redis-server ./redis.conf & |
| 52 | + cd 9003 && redis-server ./redis.conf & |
| 53 | + cd 9004 && redis-server ./redis.conf & |
| 54 | + cd 9005 && redis-server ./redis.conf & |
| 55 | + sleep 30 |
| 56 | + redis-cli --cluster create 127.0.0.1:9000 127.0.0.1:9001 127.0.0.1:9002 127.0.0.1:9003 127.0.0.1:9004 127.0.0.1:9005 --cluster-replicas 1 --cluster-yes |
| 57 | +
|
| 58 | +
|
| 59 | + copy_logs: ©_logs |
| 60 | + run: |
| 61 | + name: Copy Log Files |
| 62 | + when: always |
| 63 | + command: | |
| 64 | + mkdir log || true |
| 65 | + test -f rqueue-core/log/monitor.log && cp rqueue-core/log/monitor.log log/core-monitor.log |
| 66 | + test -f rqueue-core/log/test.log && cp rqueue-core/log/test.log log/core-test.log |
| 67 | + test -f rqueue-spring-boot-starter/log/monitor.log && cp rqueue-spring-boot-starter/log/monitor.log log/boot-monitor.log |
| 68 | + test -f rqueue-spring-boot-starter/log/test.log && cp rqueue-spring-boot-starter/log/test.log log/boot-test.log |
| 69 | + test -f rqueue-spring/log/monitor.log && cp rqueue-spring/log/monitor.log log/spring-monitor.log |
| 70 | + test -f rqueue-spring/log/test.log && cp rqueue-spring/log/test.log log/spring-test.log |
| 71 | +
|
| 72 | + copy_test_results: ©_test_results |
| 73 | + run: |
| 74 | + name: Copy Test Result Files |
| 75 | + when: always |
| 76 | + command: | |
| 77 | + mkdir test-results || true |
| 78 | + test -d rqueue-spring-boot-starter/build/reports/junit/xml && cp -r rqueue-spring-boot-starter/build/reports/junit/xml test-results |
| 79 | + test -d rqueue-spring/build/reports/junit/xml && cp -r rqueue-spring/build/reports/junit/xml test-results |
| 80 | + test -d rqueue-core/build/reports/junit/xml && cp -r rqueue-core/build/reports/junit/xml test-results |
| 81 | +
|
| 82 | + store_logs: &store_logs |
| 83 | + store_artifacts: |
| 84 | + path: log/ |
| 85 | + store_test_results: &store_test_results |
| 86 | + store_test_results: |
| 87 | + path: test-results |
| 88 | + |
| 89 | + |
| 90 | + default: &default |
| 91 | + executor: rqueue-executor |
| 92 | + <<: *environment |
| 93 | + |
| 94 | + reactive: &reactive |
| 95 | + executor: rqueue-executor |
| 96 | + <<: *reactive_environment |
| 97 | + |
| 98 | +executors: |
| 99 | + rqueue-executor: |
| 100 | + machine: |
| 101 | + image: ubuntu-2204:2022.10.2 |
| 102 | + resource_class: large |
| 103 | + |
| 104 | + working_directory: ~/repo |
| 105 | + |
| 106 | + environment: |
| 107 | + JVM_OPTS: -Xmx8g |
| 108 | + TERM: dumb |
| 109 | + ORG_GRADLE_PROJECT_mavenCentralUsername: xxx |
| 110 | + ORG_GRADLE_PROJECT_mavenCentralPassword: xxx |
| 111 | + USER_NAME: rqueue |
| 112 | + REDIS_RUNNING: "true" |
| 113 | + |
| 114 | +java_21: &java_21 |
| 115 | + run: |
| 116 | + name: Use Java 21 |
| 117 | + command: | |
| 118 | + sudo apt-get update |
| 119 | + sudo apt-get install -y openjdk-21-jdk |
| 120 | + java -version |
| 121 | + javac -version |
| 122 | +
|
| 123 | +build_steps: &build_steps |
| 124 | + steps: |
| 125 | + - checkout |
| 126 | + - *java_21 |
| 127 | + - restore_cache: |
| 128 | + keys: |
| 129 | + - v1-dependencies-{{ checksum "build.gradle" }} |
| 130 | + - v1-dependencies- |
| 131 | + - run: ./gradlew dependencies |
| 132 | + - save_cache: |
| 133 | + paths: |
| 134 | + - ~/.gradle |
| 135 | + key: v1-dependencies-{{ checksum "build.gradle" }} |
| 136 | + - run: ./gradlew compileJava |
| 137 | + - run: ./gradlew compileTestJava |
| 138 | + - persist_to_workspace: |
| 139 | + root: . |
| 140 | + paths: |
| 141 | + - . |
| 142 | + |
| 143 | +unit_test_steps: &unit_test_steps |
| 144 | + steps: |
| 145 | + - *attach_workspace |
| 146 | + - *java_21 |
| 147 | + - run: ./gradlew codeCoverageReport -DincludeTags=unit |
| 148 | + - *persist_to_workspace |
| 149 | + - *copy_logs |
| 150 | + - *copy_test_results |
| 151 | + - *store_logs |
| 152 | + - *store_test_results |
| 153 | + |
| 154 | +producer_test_steps: &producer_test_steps |
| 155 | + steps: |
| 156 | + - *attach_workspace |
| 157 | + - *java_21 |
| 158 | + - *redis_dep |
| 159 | + - run: ./gradlew codeCoverageReport -DincludeTags=producerOnly |
| 160 | + - *persist_to_workspace |
| 161 | + - *copy_logs |
| 162 | + - *copy_test_results |
| 163 | + - *store_logs |
| 164 | + - *store_test_results |
| 165 | + |
| 166 | +integration_test_steps: &integration_test_steps |
| 167 | + steps: |
| 168 | + - *attach_workspace |
| 169 | + - *java_21 |
| 170 | + - *redis_dep |
| 171 | + - run: ./gradlew codeCoverageReport -DincludeTags=integration -DexcludeTags=redisCluster,producerOnly,local |
| 172 | + - *persist_to_workspace |
| 173 | + - *copy_logs |
| 174 | + - *copy_test_results |
| 175 | + - *store_logs |
| 176 | + - *store_test_results |
| 177 | + |
| 178 | +redis_custer_test_steps: &redis_cluster_test_steps |
| 179 | + steps: |
| 180 | + - *attach_workspace |
| 181 | + - *java_21 |
| 182 | + - *redis_dep |
| 183 | + - *redis_cluster_setup |
| 184 | + - run: ./gradlew codeCoverageReport -DincludeTags=redisCluster |
| 185 | + - *persist_to_workspace |
| 186 | + - *copy_logs |
| 187 | + - *copy_test_results |
| 188 | + - *store_logs |
| 189 | + - *store_test_results |
| 190 | + |
| 191 | +report_code_coverage_steps: &report_code_coverage_steps |
| 192 | + steps: |
| 193 | + - *attach_workspace |
| 194 | + - *java_21 |
| 195 | + - run: ./gradlew coverallsJacoco |
| 196 | + - *copy_logs |
| 197 | + - *copy_test_results |
| 198 | + - *store_logs |
| 199 | + - *store_test_results |
| 200 | + |
| 201 | +jobs: |
| 202 | + build: |
| 203 | + <<: *default |
| 204 | + <<: *build_steps |
| 205 | + |
| 206 | + unit_test: |
| 207 | + <<: *default |
| 208 | + <<: *unit_test_steps |
| 209 | + |
| 210 | + producer_only_test: |
| 211 | + <<: *default |
| 212 | + <<: *producer_test_steps |
| 213 | + |
| 214 | + integration_test: |
| 215 | + <<: *default |
| 216 | + <<: *integration_test_steps |
| 217 | + |
| 218 | + reactive_integration_test: |
| 219 | + <<: *reactive |
| 220 | + <<: *integration_test_steps |
| 221 | + |
| 222 | + redis_custer_test: |
| 223 | + <<: *default |
| 224 | + <<: *redis_cluster_test_steps |
| 225 | + |
| 226 | + report_code_coverage: |
| 227 | + <<: *default |
| 228 | + <<: *report_code_coverage_steps |
| 229 | + |
| 230 | +workflows: |
| 231 | + main: |
| 232 | + jobs: |
| 233 | + - build |
| 234 | + - unit_test: |
| 235 | + requires: |
| 236 | + - build |
| 237 | + - producer_only_test: |
| 238 | + requires: |
| 239 | + - unit_test |
| 240 | + - integration_test: |
| 241 | + requires: |
| 242 | + - producer_only_test |
| 243 | + - redis_custer_test: |
| 244 | + requires: |
| 245 | + - integration_test |
| 246 | + - reactive_integration_test: |
| 247 | + requires: |
| 248 | + - redis_custer_test |
| 249 | + - report_code_coverage: |
| 250 | + requires: |
| 251 | + - reactive_integration_test |
0 commit comments