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 testSpringCoatRelease -x testSpringCoatDebug -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>>-<<parameters.where>>/"
122 <<parameters.find>> . -type f -regex '.*/'"<<parameters.where>>"'/junit/.*\.xml' -exec cp {} "<<parameters.home>>/test-results/junit-<<parameters.os>>-<<parameters.where>>/" \;
125 shell: <<parameters.shell>>
126 name: Save test results
128 mkdir -p "<<parameters.home>>/test-results/csv-<<parameters.os>>-<<parameters.where>>/"
129 <<parameters.find>> . -type f -regex '.*/'"<<parameters.where>>"'/csv/.*\.csv' -exec cp {} "<<parameters.home>>/test-results/csv-<<parameters.os>>-<<parameters.where>>/" \;
132 shell: <<parameters.shell>>
135 mkdir -p "<<parameters.home>>/test-results/nps-<<parameters.vm>>-<<parameters.os>>-<<parameters.where>>/"
136 <<parameters.find>> . -type f -regex '.*/'"<<parameters.where>>"'/nps/.*\.nps' -exec cp {} "<<parameters.home>>/test-results/nps-<<parameters.vm>>-<<parameters.os>>-<<parameters.where>>/" \;
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: 30m
176 where: "vm-test-hosted-debug"
181 home: "/c/users/circleci/"
182 store-home: "c:/users/circleci/"
184 where: "vm-test-hosted-release"
189 home: "/c/users/circleci/"
190 store-home: "c:/users/circleci/"
192 build_windows_standalone:
198 # Use a reduced amount of memory to all the VMs so that it does not
199 # try grabbing all the memory that is available to the system.
207 name: Construct Standalone
208 command: ./gradlew :emulators:standalone:shadowJar <<pipeline.parameters.standard-gradle-options >>
211 name: Remove distracting JAR, if any
212 command: rm emulators/standalone/build/libs/standalone-*.jar
214 path: emulators/standalone/build/libs/
217 ratufacoat_build_windows:
223 # Use a reduced amount of memory to all the VMs so that it does not
224 # try grabbing all the memory that is available to the system.
231 name: Install required dependencies
232 working_directory: ratufacoat
234 command: choco install cmake.install
236 name: Setup CMake build
237 working_directory: ratufacoat
240 "$PROGRAMFILES/CMake/bin/cmake.exe" .
242 name: Compile CMake build
243 working_directory: ratufacoat
246 "$PROGRAMFILES/CMake/bin/cmake.exe" --build .
248 path: ratufacoat\src\Debug\SquirrelJME.exe
249 destination: SquirrelJME.exe
251 ################################# MAC OS X #################################
253 executor: build-on-macos
257 # Only OpenJDK is required, Gradle always uses Gradle wrapper so
258 # we do not need that
259 name: Install OpenJDK 11
260 command: brew install openjdk@11 coreutils
262 name: Gradle Build and Test
263 command: timeout --foreground 30m ./gradlew <<pipeline.parameters.standard-build-options>> <<pipeline.parameters.standard-gradle-options>>
264 no_output_timeout: 30m
267 where: "vm-test-hosted-debug"
271 where: "vm-test-hosted-release"
275 executor: build-on-macos-m1
279 name: Gradle Build and Test
280 command: timeout --foreground 30m ./gradlew <<pipeline.parameters.standard-build-options>> <<pipeline.parameters.standard-gradle-options>>
281 no_output_timeout: 30m
284 where: "vm-test-hosted-debug"
288 where: "vm-test-hosted-release"
292 build_macosx_standalone:
293 executor: build-on-macos
297 # Only OpenJDK is required, Gradle always uses Gradle wrapper so
298 # we do not need that
299 name: Install OpenJDK 11
300 command: brew install openjdk@11 coreutils
304 name: Construct Standalone
305 command: ./gradlew :emulators:standalone:shadowJar <<pipeline.parameters.standard-gradle-options>>
307 name: Remove distracting JAR, if any
308 command: rm emulators/standalone/build/libs/standalone-*.jar
310 path: emulators/standalone/build/libs/
312 build_macosx_m1_standalone:
313 executor: build-on-macos-m1
319 name: Construct Standalone
320 command: ./gradlew :emulators:standalone:shadowJar <<pipeline.parameters.standard-gradle-options>>
322 name: Remove distracting JAR, if any
323 command: rm emulators/standalone/build/libs/standalone-*.jar
325 path: emulators/standalone/build/libs/
328 ratufacoat_build_macosx:
329 executor: build-on-macos
334 command: brew install cmake coreutils
338 name: Setup CMake build
339 working_directory: ratufacoat
342 name: Compile CMake build
343 working_directory: ratufacoat
344 command: cmake --build .
346 path: ratufacoat/src/SquirrelJME
347 destination: SquirrelJME
349 ################################### LINUX ##################################
351 executor: build-on-linux-amd64
354 - linux-install-required
356 name: Gradle Build and Test
357 command: timeout --foreground 30m ./gradlew <<pipeline.parameters.standard-build-options>> <<pipeline.parameters.standard-gradle-options>>
358 no_output_timeout: 30m
360 where: "vm-test-hosted-debug"
364 where: "vm-test-hosted-release"
368 build_linux_amd64_standalone:
369 executor: build-on-linux-amd64
372 - linux-install-required
376 name: Construct Standalone
377 command: ./gradlew :emulators:standalone:shadowJar <<pipeline.parameters.standard-gradle-options>>
379 name: Remove distracting JAR, if any
380 command: rm emulators/standalone/build/libs/standalone-*.jar
382 path: emulators/standalone/build/libs/
386 executor: build-on-linux-arm64
389 - linux-install-required
391 name: Gradle Build and Test
392 command: timeout --foreground 30m ./gradlew <<pipeline.parameters.standard-build-options>> <<pipeline.parameters.standard-gradle-options>>
393 no_output_timeout: 30m
395 where: "vm-test-hosted-debug"
399 where: "vm-test-hosted-release"
403 build_linux_arm64_standalone:
404 executor: build-on-linux-arm64
407 - linux-install-required
411 name: Construct Standalone
412 command: ./gradlew :emulators:standalone:shadowJar <<pipeline.parameters.standard-gradle-options>>
414 name: Remove distracting JAR, if any
415 command: rm emulators/standalone/build/libs/standalone-*.jar
417 path: emulators/standalone/build/libs/
420 ### OSS SonaType Nexus
422 executor: build-on-linux-amd64
425 - linux-install-required
429 name: Publish to OSS SonaType
430 command: ./gradlew publishMavenPublicationToMavenRepository <<pipeline.parameters.standard-gradle-options>> || circleci-agent step halt
433 ratufacoat_build_linux:
434 executor: build-on-linux-amd64
437 - linux-install-required
441 name: Setup CMake build
442 working_directory: ratufacoat
445 name: Compile CMake build
446 working_directory: ratufacoat
447 command: cmake --build .
449 path: ratufacoat/src/SquirrelJME
450 destination: SquirrelJME
453 test_springcoat_debug:
454 executor: build-on-linux-amd64
457 - linux-install-required
461 name: SpringCoat Tests
462 command: timeout --foreground 30m ./gradlew testSpringCoatDebug <<pipeline.parameters.standard-gradle-options>>
463 no_output_timeout: 30m
465 where: "vm-test-springcoat-debug"
468 test_springcoat_release:
469 executor: build-on-linux-amd64
472 - linux-install-required
476 name: SpringCoat Tests
477 command: timeout --foreground 30m ./gradlew testSpringCoatRelease <<pipeline.parameters.standard-gradle-options>>
478 no_output_timeout: 30m
480 where: "vm-test-springcoat-release"
485 executor: build-on-linux-amd64
488 - linux-install-required
492 name: SummerCoat Tests
493 command: timeout --foreground 30m ./gradlew testSummerCoat <<pipeline.parameters.standard-gradle-options>>
494 no_output_timeout: 30m
496 where: "vm-test-summercoat-debug"
500 where: "vm-test-summercoat-release"
504 ################################### USERS ##################################
506 executor: build-on-linux-amd64
509 - linux-install-required
512 command: git clone git@github.com:SquirrelJME/SquirrelJME.wiki.git /tmp/wiki
515 command: .circleci/squirreljme-wikify-user-guide.sh "$(pwd)" "/tmp/wiki"
517 name: Update Git User
519 cd "/tmp/wiki" && git config user.name "SquirrelJME Automation" && git config user.email "xerthesquirrel+squirreljme@gmail.com"
523 cd "/tmp/wiki" && git commit -m "Synchronize User-Guide" || echo "Ignoring commit."
526 - "26:b8:ae:4d:53:64:4c:6a:59:3d:a6:60:44:90:9d:6c"
530 cd "/tmp/wiki" && git push
532 ################################ CONSTRUCTION ###############################
533 # Runs the `testJar` task so any operations following this will run faster
534 # when they need to use these JARs
536 executor: build-on-linux-amd64
539 - linux-install-required
543 name: Construct Test JARs
544 command: ./gradlew testJar <<pipeline.parameters.standard-gradle-options>>
547 # Constructs the ROM fragment libraries for SummerCoat, since they are used
548 # for general ROM construction
549 construct_libSummerCoat:
550 executor: build-on-linux-amd64
553 - linux-install-required
557 name: Construct SummerCoat Libraries
558 command: ./gradlew libSummerCoat <<pipeline.parameters.standard-gradle-options>>
561 # All the tests so that they can run from within SummerCoat
562 construct_libTestSummerCoat:
563 executor: build-on-linux-amd64
566 - linux-install-required
570 name: Construct Test SummerCoat Libraries
571 command: ./gradlew libTestSummerCoat <<pipeline.parameters.standard-gradle-options>>
574 # Constructs the standard SummerCoat ROM, could be uploaded later
575 construct_romSummerCoat:
576 executor: build-on-linux-amd64
579 - linux-install-required
583 name: Construct SummerCoat ROM
584 command: ./gradlew romSummerCoat <<pipeline.parameters.standard-gradle-options>>
587 # Constructs the test SummerCoat ROM, could be uploaded later, this is so
588 # that any RatufaCoats have an actual ROM that can be tested to ensure that
590 construct_romTestSummerCoat:
591 executor: build-on-linux-amd64
594 - linux-install-required
598 name: Construct Test SummerCoat ROM
599 command: ./gradlew romTestSummerCoat <<pipeline.parameters.standard-gradle-options>>
606 ############################# STANDARD TESTS ############################
608 # - build_linux_arm64
609 - test_springcoat_debug:
612 - test_springcoat_release:
617 # - construct_libTestSummerCoat
618 - build_linux_amd64_standalone:
621 # - build_linux_arm64_standalone:
623 # - build_linux_arm64
625 # Mac OS X runs decently however the jobs for it have a higher cost, so
626 # only perform builds and tests for trunk to lower costs.
627 # Currently I have an overabundance of credits...
638 - build_macosx_standalone:
641 - build_macosx_m1_standalone:
645 # Building on Windows is currently expensive and takes longer, so only
646 # run these builds on trunk to lower costs.
647 # Currently have an overabundance of credits...
655 - build_windows_standalone:
659 # Publishing to OSS Sonatype Nexus (https://oss.sonatype.org)
669 ###################### LIBRARY AND ROM CONSTRUCTION #####################
670 - construct_testJars:
673 # - construct_libSummerCoat:
675 # - build_linux_amd64
676 # - construct_libTestSummerCoat:
678 # - construct_testJars
679 # - construct_romSummerCoat:
681 # - construct_libSummerCoat
682 # - construct_romTestSummerCoat:
684 # - construct_libTestSummerCoat
686 ############################## RATUFACOAT ##############################
687 # - ratufacoat_build_windows:
690 # - construct_romTestSummerCoat
691 # - ratufacoat_build_linux:
693 # - build_linux_amd64
694 # - construct_romTestSummerCoat
695 # - ratufacoat_build_macosx:
698 # - construct_romTestSummerCoat
700 #################### TASKS TO INCREASE USER FRIENDLINESS ####################