1 # ---------------------------------------------------------------------------
2 # Multi-Phasic Applications: SquirrelJME
3 # Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
4 # Copyright (C) Multi-Phasic Applications <multiphasicapps.net>
5 # ---------------------------------------------------------------------------
6 # SquirrelJME is under the GNU General Public License v3, or later.
7 # See license.mkd for licensing and copyright information.
8 # ---------------------------------------------------------------------------
9 # DESCRIPTION: CircleCI Build Configuration
10 # SourceForge: squirreljme@frs.sourceforge.net
11 # SourceForge Root: /home/frs/project/squirreljme/AutoBuild/
12 # CircleCI Reference: https://circleci.com/docs/2.0/env-vars/
19 - image: cimg/openjdk:11.0
20 resource_class: medium
22 # Allow Gradle to be fully cached
23 GRADLE_USER_HOME: ${CIRCLE_WORKING_DIRECTORY}/.gradle/home
26 - image: cimg/ubuntu-2004:current
27 resource_class: arm.medium
29 # Allow Gradle to be fully cached
30 GRADLE_USER_HOME: ${CIRCLE_WORKING_DIRECTORY}/.gradle/home
32 # This is in the documentation but does not actually work, new feature?
37 # resource_class: medium
39 # # Use a reduced amount of memory to all the VMs so that it does not
40 # # try grabbing all the memory that is available to the system.
46 resource_class: macos.x86.medium.gen2
48 # Do not auto-update brew as this takes forever, and we really just want
50 HOMEBREW_NO_AUTO_UPDATE: 1
52 # Do not auto-clean brew, this wastes time and everything will be thrown
53 # out when the container finishes anyway
54 HOMEBREW_CLEANUP_MAX_AGE_DAYS: 730
56 # Do not send analytics
57 HOMEBREW_NO_ANALYTICS: 1
59 # Do not clean up after installation
60 HOMEBREW_NO_INSTALL_CLEANUP: 1
64 resource_class: squirreljme/squirreljme-macos-m1
67 win: circleci/windows@2.4.0
69 # Parameters to simplify commands
71 # Options to be used for any Gradle command, is faster this way
72 standard-gradle-options:
74 default: --console plain --continue --parallel --no-daemon --stacktrace
76 # Standard build for systems
77 standard-build-options:
79 default: build testHosted -x testSpringCoat -x javadoc -x javadocJar -x sourcesJar -x markdownJavaDoc
81 # Commands that are used by almost everything
83 # Save Gradle cache and such so subsequent builds are faster
86 - persist_to_workspace:
95 # Saving of test results, since this is duplicated for many OSes
109 default: ./.no-persist/
115 default: ./.no-persist/
118 shell: <<parameters.shell>>
119 name: Save test results
121 mkdir -p "<<parameters.home>>/test-results/junit-<<parameters.os>>/"
122 <<parameters.find>> . -type f -regex '.*/'"<<parameters.where>>"'/junit/.*\.xml' -exec cp {} "<<parameters.home>>/test-results/junit-<<parameters.os>>/" \;
125 shell: <<parameters.shell>>
126 name: Save test results
128 mkdir -p "<<parameters.home>>/test-results/csv-<<parameters.os>>/"
129 <<parameters.find>> . -type f -regex '.*/'"<<parameters.where>>"'/csv/.*\.csv' -exec cp {} "<<parameters.home>>/test-results/csv-<<parameters.os>>/" \;
132 shell: <<parameters.shell>>
135 mkdir -p "<<parameters.home>>/test-results/nps-<<parameters.vm>>-<<parameters.os>>/"
136 <<parameters.find>> . -type f -regex '.*/'"<<parameters.where>>"'/nps/.*\.nps' -exec cp {} "<<parameters.home>>/test-results/nps-<<parameters.vm>>-<<parameters.os>>/" \;
138 - store_test_results:
139 path: <<parameters.store-home>>/test-results
141 path: <<parameters.store-home>>/test-results
143 # Install standard packages in Debian/Ubuntu
144 linux-install-required:
147 name: Update package lists
148 command: sudo apt-get update -y
150 name: Install required dependencies
151 command: sudo apt-get install -y --no-install-recommends cmake build-essential curl wget openjdk-11-jdk gcc g++ make
154 ################################## WINDOWS #################################
161 # Use a reduced amount of memory to all the VMs so that it does not
162 # try grabbing all the memory that is available to the system.
168 name: Gradle Build and Test
169 # According to documentation, Gradle on Windows has trouble and tries
170 # to make way too many workers which causes extreme resource.
171 # contention --max-workers=2
172 command: gradlew <<pipeline.parameters.standard-build-options>> <<pipeline.parameters.standard-gradle-options>>
173 no_output_timeout: 7m
176 where: "vm-test-hosted"
181 home: "/c/users/circleci/"
182 store-home: "c:/users/circleci/"
184 build_windows_standalone:
190 # Use a reduced amount of memory to all the VMs so that it does not
191 # try grabbing all the memory that is available to the system.
199 name: Construct Standalone
200 command: ./gradlew :emulators:standalone:shadowJar <<pipeline.parameters.standard-gradle-options >>
203 name: Remove distracting JAR, if any
204 command: rm emulators/standalone/build/libs/standalone-*.jar
206 path: emulators/standalone/build/libs/
209 ratufacoat_build_windows:
215 # Use a reduced amount of memory to all the VMs so that it does not
216 # try grabbing all the memory that is available to the system.
223 name: Install required dependencies
224 working_directory: ratufacoat
226 command: choco install cmake.install
228 name: Setup CMake build
229 working_directory: ratufacoat
232 "$PROGRAMFILES/CMake/bin/cmake.exe" .
234 name: Compile CMake build
235 working_directory: ratufacoat
238 "$PROGRAMFILES/CMake/bin/cmake.exe" --build .
240 path: ratufacoat\src\Debug\SquirrelJME.exe
241 destination: SquirrelJME.exe
243 ################################# MAC OS X #################################
245 executor: build-on-macos
249 # Only OpenJDK is required, Gradle always uses Gradle wrapper so
250 # we do not need that
251 name: Install OpenJDK 11
252 command: brew install openjdk@11 coreutils
254 name: Gradle Build and Test
255 command: timeout --foreground 7m ./gradlew <<pipeline.parameters.standard-build-options>> <<pipeline.parameters.standard-gradle-options>>
256 no_output_timeout: 7m
259 where: "vm-test-hosted"
263 executor: build-on-macos-m1
267 name: Gradle Build and Test
268 command: timeout --foreground 7m ./gradlew <<pipeline.parameters.standard-build-options>> <<pipeline.parameters.standard-gradle-options>>
269 no_output_timeout: 7m
272 where: "vm-test-hosted"
276 build_macosx_standalone:
277 executor: build-on-macos
281 # Only OpenJDK is required, Gradle always uses Gradle wrapper so
282 # we do not need that
283 name: Install OpenJDK 11
284 command: brew install openjdk@11 coreutils
288 name: Construct Standalone
289 command: ./gradlew :emulators:standalone:shadowJar <<pipeline.parameters.standard-gradle-options>>
291 name: Remove distracting JAR, if any
292 command: rm emulators/standalone/build/libs/standalone-*.jar
294 path: emulators/standalone/build/libs/
296 build_macosx_m1_standalone:
297 executor: build-on-macos-m1
303 name: Construct Standalone
304 command: ./gradlew :emulators:standalone:shadowJar <<pipeline.parameters.standard-gradle-options>>
306 name: Remove distracting JAR, if any
307 command: rm emulators/standalone/build/libs/standalone-*.jar
309 path: emulators/standalone/build/libs/
312 ratufacoat_build_macosx:
313 executor: build-on-macos
318 command: brew install cmake coreutils
322 name: Setup CMake build
323 working_directory: ratufacoat
326 name: Compile CMake build
327 working_directory: ratufacoat
328 command: cmake --build .
330 path: ratufacoat/src/SquirrelJME
331 destination: SquirrelJME
333 ################################### LINUX ##################################
335 executor: build-on-linux-amd64
338 - linux-install-required
340 name: Gradle Build and Test
341 command: timeout --foreground 7m ./gradlew <<pipeline.parameters.standard-build-options>> <<pipeline.parameters.standard-gradle-options>>
342 no_output_timeout: 7m
344 where: "vm-test-hosted"
348 build_linux_amd64_standalone:
349 executor: build-on-linux-amd64
352 - linux-install-required
356 name: Construct Standalone
357 command: ./gradlew :emulators:standalone:shadowJar <<pipeline.parameters.standard-gradle-options>>
359 name: Remove distracting JAR, if any
360 command: rm emulators/standalone/build/libs/standalone-*.jar
362 path: emulators/standalone/build/libs/
366 executor: build-on-linux-arm64
369 - linux-install-required
371 name: Gradle Build and Test
372 command: timeout --foreground 7m ./gradlew <<pipeline.parameters.standard-build-options>> <<pipeline.parameters.standard-gradle-options>>
373 no_output_timeout: 7m
375 where: "vm-test-hosted"
379 build_linux_arm64_standalone:
380 executor: build-on-linux-arm64
383 - linux-install-required
387 name: Construct Standalone
388 command: ./gradlew :emulators:standalone:shadowJar <<pipeline.parameters.standard-gradle-options>>
390 name: Remove distracting JAR, if any
391 command: rm emulators/standalone/build/libs/standalone-*.jar
393 path: emulators/standalone/build/libs/
396 ### OSS SonaType Nexus
398 executor: build-on-linux-amd64
401 - linux-install-required
405 name: Publish to OSS SonaType
406 command: ./gradlew publishMavenPublicationToMavenRepository <<pipeline.parameters.standard-gradle-options>> || circleci-agent step halt
409 ratufacoat_build_linux:
410 executor: build-on-linux-amd64
413 - linux-install-required
417 name: Setup CMake build
418 working_directory: ratufacoat
421 name: Compile CMake build
422 working_directory: ratufacoat
423 command: cmake --build .
425 path: ratufacoat/src/SquirrelJME
426 destination: SquirrelJME
430 executor: build-on-linux-amd64
433 - linux-install-required
437 name: SpringCoat Tests
438 command: timeout --foreground 17m ./gradlew testSpringCoat <<pipeline.parameters.standard-gradle-options>>
439 no_output_timeout: 17m
441 where: "vm-test-springcoat"
445 executor: build-on-linux-amd64
448 - linux-install-required
452 name: SummerCoat Tests
453 command: timeout --foreground 15m ./gradlew testSummerCoat <<pipeline.parameters.standard-gradle-options>>
454 no_output_timeout: 15m
456 where: "vm-test-summercoat"
460 ################################### USERS ##################################
462 executor: build-on-linux-amd64
465 - linux-install-required
468 command: git clone git@github.com:SquirrelJME/SquirrelJME.wiki.git /tmp/wiki
471 command: .circleci/squirreljme-wikify-user-guide.sh "$(pwd)" "/tmp/wiki"
473 name: Update Git User
475 cd "/tmp/wiki" && git config user.name "SquirrelJME Automation" && git config user.email "xerthesquirrel+squirreljme@gmail.com"
479 cd "/tmp/wiki" && git commit -m "Synchronize User-Guide" || echo "Ignoring commit."
482 - "26:b8:ae:4d:53:64:4c:6a:59:3d:a6:60:44:90:9d:6c"
486 cd "/tmp/wiki" && git push
488 ################################ CONSTRUCTION ###############################
489 # Runs the `testJar` task so any operations following this will run faster
490 # when they need to use these JARs
492 executor: build-on-linux-amd64
495 - linux-install-required
499 name: Construct Test JARs
500 command: ./gradlew testJar <<pipeline.parameters.standard-gradle-options>>
503 # Constructs the ROM fragment libraries for SummerCoat, since they are used
504 # for general ROM construction
505 construct_libSummerCoat:
506 executor: build-on-linux-amd64
509 - linux-install-required
513 name: Construct SummerCoat Libraries
514 command: ./gradlew libSummerCoat <<pipeline.parameters.standard-gradle-options>>
517 # All the tests so that they can run from within SummerCoat
518 construct_libTestSummerCoat:
519 executor: build-on-linux-amd64
522 - linux-install-required
526 name: Construct Test SummerCoat Libraries
527 command: ./gradlew libTestSummerCoat <<pipeline.parameters.standard-gradle-options>>
530 # Constructs the standard SummerCoat ROM, could be uploaded later
531 construct_romSummerCoat:
532 executor: build-on-linux-amd64
535 - linux-install-required
539 name: Construct SummerCoat ROM
540 command: ./gradlew romSummerCoat <<pipeline.parameters.standard-gradle-options>>
543 # Constructs the test SummerCoat ROM, could be uploaded later, this is so
544 # that any RatufaCoats have an actual ROM that can be tested to ensure that
546 construct_romTestSummerCoat:
547 executor: build-on-linux-amd64
550 - linux-install-required
554 name: Construct Test SummerCoat ROM
555 command: ./gradlew romTestSummerCoat <<pipeline.parameters.standard-gradle-options>>
562 ############################# STANDARD TESTS ############################
564 # - build_linux_arm64
570 # - construct_libTestSummerCoat
571 - build_linux_amd64_standalone:
574 # - build_linux_arm64_standalone:
576 # - build_linux_arm64
578 # Mac OS X runs decently however the jobs for it have a higher cost, so
579 # only perform builds and tests for trunk to lower costs.
580 # Currently I have an overabundance of credits...
591 - build_macosx_standalone:
594 - build_macosx_m1_standalone:
598 # Building on Windows is currently expensive and takes longer, so only
599 # run these builds on trunk to lower costs.
600 # Currently have an overabundance of credits...
608 - build_windows_standalone:
612 # Publishing to OSS Sonatype Nexus (https://oss.sonatype.org)
622 ###################### LIBRARY AND ROM CONSTRUCTION #####################
623 - construct_testJars:
626 # - construct_libSummerCoat:
628 # - build_linux_amd64
629 # - construct_libTestSummerCoat:
631 # - construct_testJars
632 # - construct_romSummerCoat:
634 # - construct_libSummerCoat
635 # - construct_romTestSummerCoat:
637 # - construct_libTestSummerCoat
639 ############################## RATUFACOAT ##############################
640 # - ratufacoat_build_windows:
643 # - construct_romTestSummerCoat
644 # - ratufacoat_build_linux:
646 # - build_linux_amd64
647 # - construct_romTestSummerCoat
648 # - ratufacoat_build_macosx:
651 # - construct_romTestSummerCoat
653 #################### TASKS TO INCREASE USER FRIENDLINESS ####################