Add blank classes for DoJa graphics3d.
[SquirrelJME.git] / .circleci / config.yml
blob489c321cd1ff8f642248095a9f3286c4c6613933
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/
14 version: 2.1
16 executors:
17   build-on-linux-amd64:
18     #docker:
19     #  - image: debian:bookworm
20     machine:
21       image: ubuntu-2204:2024.01.1
22     resource_class: medium
23     environment:
24       # Allow Gradle to be fully cached
25       GRADLE_USER_HOME: ${CIRCLE_WORKING_DIRECTORY}/.gradle/home
27       # Fix Debian package install
28       DEBIAN_FRONTEND: noninteractive
29       NEEDRESTART_MODE: l
30       NEEDRESTART_SUSPEND: 1
32   build-on-linux-arm64:
33     #docker:
34     #  - image: debian:bookworm
35     machine:
36       image: ubuntu-2204:2024.01.1
37     resource_class: arm.medium
38     environment:
39       # Allow Gradle to be fully cached
40       GRADLE_USER_HOME: ${CIRCLE_WORKING_DIRECTORY}/.gradle/home
42       # Fix Debian package install
43       DEBIAN_FRONTEND: noninteractive
44       NEEDRESTART_MODE: l
45       NEEDRESTART_SUSPEND: 1
47   build-on-linux-riscv64:
48     machine: true
49     resource_class: squirreljme/squirreljme-linux-riscv64
51   # This is in the documentation but does not actually work, new feature?
52   #  build-on-windows:
53   #    windows:
54   #      name: win/default
55   #      shell: cmd.exe
56   #    resource_class: medium
57   #    environment:
58   #      # Use a reduced amount of memory to all the VMs so that it does not
59   #      # try grabbing all the memory that is available to the system.
60   #      JAVA_OPTS: -Xmx3g
62   build-on-macos:
63     machine: true
64     resource_class: squirreljme/squirreljme-macos-x86
66   build-on-macos-m1:
67     machine: true
68     resource_class: squirreljme/squirreljme-macos-m1
70   squirreljme-bundle:
71     machine: true
72     resource_class: squirreljme/bundle
74 orbs:
75   win: circleci/windows@5.0
77 # Parameters to simplify commands
78 parameters:
79   # Options to be used for any Gradle command, is faster this way
80   standard-gradle-options:
81     type: string
82     default: --console plain --continue --parallel --no-daemon --stacktrace
84   standard-exclusion:
85     type: string
86     default: -x testSpringCoat -x testSpringCoatRelease -x testSpringCoatDebug -x javadoc -x javadocJar -x sourcesJar -x markdownJavaDoc
88   # Standard build for systems
89   standard-build-options:
90     type: string
91     default: build testHosted <<pipeline.parameters.standard-exclusion>>
93   # Windows JDK versions
94   windows-jdk-base-dir:
95     type: string
96     default: jdk-11.0.23
97   windows-jdk-i386:
98     type: string
99     default: https://download.bell-sw.com/java/11.0.23+12/bellsoft-jdk11.0.23+12-windows-i586.zip
100   windows-jdk-amd64:
101     type: string
102     default: https://download.bell-sw.com/java/11.0.23+12/bellsoft-jdk11.0.23+12-windows-amd64.zip
104 # Commands that are used by almost everything
105 commands:
106   # Save Gradle cache and such so subsequent builds are faster
107   persist-gradle:
108     steps:
109       - persist_to_workspace:
110           root: .
111           paths:
112             - '.gradle/*'
113             - 'build/*'
114             - '*/.gradle/*'
115             - '*/build/*'
116             - '*/*/build/*'
118   # Saving of test results, since this is duplicated for many OSes
119   save-test-results:
120     parameters:
121       where:
122         type: string
123       os:
124         type: string
125       vm:
126         type: string
127       shell:
128         type: string
129         default: "/bin/bash"
130       home:
131         type: string
132         default: ./.no-persist/
133       find:
134         type: string
135         default: find
136       store-home:
137         type: string
138         default: ./.no-persist/
139     steps:
140       - run:
141           shell: <<parameters.shell>>
142           name: Save test results
143           command: |
144             mkdir -p "<<parameters.home>>/test-results/junit-<<parameters.os>>-<<parameters.where>>/"
145             <<parameters.find>> . -type f -regex '.*/'"<<parameters.where>>"'/junit/.*\.xml' -exec cp {} "<<parameters.home>>/test-results/junit-<<parameters.os>>-<<parameters.where>>/" \;
146           when: always
147       - run:
148           shell: <<parameters.shell>>
149           name: Save test results
150           command: |
151             mkdir -p "<<parameters.home>>/test-results/csv-<<parameters.os>>-<<parameters.where>>/"
152             <<parameters.find>> . -type f -regex '.*/'"<<parameters.where>>"'/csv/.*\.csv' -exec cp {} "<<parameters.home>>/test-results/csv-<<parameters.os>>-<<parameters.where>>/" \;
153           when: always
154       - run:
155           shell: <<parameters.shell>>
156           name: Save snapshots
157           command: |
158             mkdir -p "<<parameters.home>>/test-results/nps-<<parameters.vm>>-<<parameters.os>>-<<parameters.where>>/"
159             <<parameters.find>> . -type f -regex '.*/'"<<parameters.where>>"'/nps/.*\.nps' -exec cp {} "<<parameters.home>>/test-results/nps-<<parameters.vm>>-<<parameters.os>>-<<parameters.where>>/" \;
160           when: always
161       - store_test_results:
162           path: <<parameters.store-home>>/test-results
163       - store_artifacts:
164           path: <<parameters.store-home>>/test-results
166   # Standard apt-get install
167   linux-debian-apt-get-install:
168     parameters:
169       packages:
170         type: string
171     steps:
172       - run:
173           name: Install packages
174           environment:
175             DEBIAN_FRONTEND: noninteractive
176             NEEDRESTART_MODE: l
177             NEEDRESTART_SUSPEND: 1
178           command: |
179             sudo apt-get install -y --no-install-recommends <<parameters.packages>>
181   # Standard apt-get install, optional
182   linux-debian-apt-get-install-optional:
183     parameters:
184       packages:
185         type: string
186       look:
187         type: string
188     steps:
189       - run:
190           name: Install packages (optional)
191           environment:
192             DEBIAN_FRONTEND: noninteractive
193             NEEDRESTART_MODE: l
194             NEEDRESTART_SUSPEND: 1
195           command: |
196             if ! which "<<parameters.look>>"; then sudo apt-get install -y --no-install-recommends <<parameters.packages>> || echo "Failed, but ignoring..."; fi
198   # Install standard packages in Debian/Ubuntu
199   linux-install-required:
200     steps:
201       - run:
202           name: Install Sudo
203           environment:
204             DEBIAN_FRONTEND: noninteractive
205             NEEDRESTART_MODE: l
206             NEEDRESTART_SUSPEND: 1
207           command: apt-get update -y && apt-get -yqq install sudo || echo "Failed, but ignoring..."
208       - run:
209           name: Update package lists
210           environment:
211             DEBIAN_FRONTEND: noninteractive
212             NEEDRESTART_MODE: l
213             NEEDRESTART_SUSPEND: 1
214           command: sudo apt-get update -y
215       - linux-debian-apt-get-install:
216           packages: cmake build-essential curl wget gcc g++ make clang git openssh-client
217       - linux-debian-apt-get-install-optional:
218           look: javac
219           packages: openjdk-17-jdk
220       - linux-debian-apt-get-install-optional:
221           look: javac
222           packages: openjdk-11-jdk
223       - linux-debian-apt-get-install-optional:
224           look: javac
225           packages: openjdk-8-jdk
226       - linux-debian-apt-get-install-optional:
227           look: javac
228           packages: openjdk-7-jdk
230   # Install required packages on Windows
231   windows-install-required:
232     steps:
233       - run:
234           name: Install CMake
235           shell: cmd.exe
236           command: choco install cmake -y
237       - run:
238           name: Install CMake (Retry)
239           shell: cmd.exe
240           command: choco install cmake -y
241           when: on_fail
242       - run:
243           name: Install Mingw-w64
244           shell: cmd.exe
245           command: choco install mingw -y
246       - run:
247           name: Install Mingw-w64 (Retry)
248           shell: cmd.exe
249           command: choco install mingw -y
250           when: on_fail
252   # Windows JDK Install
253   windows-install-jdk:
254     parameters:
255       jdk-url:
256         type: string
257     steps:
258       - run:
259           shell: bash.exe
260           name: Download Older JDK
261           command: curl -o /c/users/circleci/jdk.zip <<parameters.jdk-url>>
262       - run:
263           shell: bash.exe
264           name: Extract Older JDK
265           command: unzip /c/users/circleci/jdk.zip
266       - persist_to_workspace:
267           root: .
268           paths:
269             - <<pipeline.parameters.windows-jdk-base-dir>>/
271   # Install required packages on macOS
272   macos-install-required:
273     steps:
274       - run:
275           # Only OpenJDK is required, Gradle always uses Gradle wrapper so
276           # we do not need that... also CMake as well for native code
277           name: Install Dependencies
278           command: brew install openjdk@11 coreutils cmake
279       - run:
280           name: Install Dependencies (Retry)
281           command: brew install openjdk@11 coreutils cmake
282           when: on_fail
284   # Install what is required by Flatpak
285   flatpak-install-required:
286     steps:
287       - linux-debian-apt-get-install:
288           packages: flatpak flatpak-builder
289       - run:
290           name: Register Flathub
291           command: flatpak remote-add --user flathub https://dl.flathub.org/repo/flathub.flatpakrepo
292       - run:
293           name: Flatpak FreeDesktop Platform
294           command: flatpak install --user -y --noninteractive flathub org.freedesktop.Platform//23.08
295       - run:
296           name: Flatpak FreeDesktop SDK
297           command: flatpak install --user -y --noninteractive flathub org.freedesktop.Sdk//23.08
298       - run:
299           name: Flatpak OpenJDK
300           command: flatpak install --user -y --noninteractive flathub runtime/org.freedesktop.Sdk.Extension.openjdk11//23.08
302   # Flatpak Common Build Rules
303   flatpak-common-build:
304     parameters:
305       arch:
306         type: string
307     steps:
308       - run:
309           name: Flatpak Build and Install
310           command: flatpak-builder --user --install --install-deps-from=flathub --allow-missing-runtimes --force-clean build-dir cc.squirreljme.SquirrelJME.yml
311       - run:
312           name: Flatpak Bundle
313           command: flatpak build-bundle $HOME/.local/share/flatpak/repo squirreljme-0.3.0-<<parameters.arch>>.flatpak cc.squirreljme.SquirrelJME
314       - store_artifacts:
315           path: squirreljme-0.3.0-<<parameters.arch>>.flatpak
316           destination: squirreljme-0.3.0-<<parameters.arch>>.flatpak
318   # Common Build for Standalone (UNIX)
319   standalone-unix-common-build:
320     steps:
321       - run:
322           name: Construct Standalone
323           command: ./gradlew :emulators:standalone:shadowJar <<pipeline.parameters.standard-gradle-options>>
324       - run:
325           name: Construct Standalone (Retry)
326           command: ./gradlew :emulators:standalone:shadowJar <<pipeline.parameters.standard-gradle-options>>
327           when: on_fail
328       - run:
329           name: Remove distracting JAR, if any
330           command: rm emulators/standalone/build/libs/standalone-*.jar
331       - store_artifacts:
332           path: emulators/standalone/build/libs/
333           destination: .
335 jobs:
336   ################################## BUNDLE ##################################
337   bundle:
338     executor: squirreljme-bundle
339     steps:
340       - run:
341           name: Delete working directory
342           command: rm -rf /home/circleci/work/co || echo "Ignoring..."
343       - run:
344           name: Setup working directory
345           command: mkdir -p /home/circleci/work/co || echo "Ignoring..."
346       - run:
347           name: Open repository
348           working_directory: /home/circleci/work/co
349           command: fossil open /home/repo/squirreljme.fossil --force
350       - run:
351           name: Checkout trunk
352           working_directory: /home/circleci/work/co
353           command: fossil checkout trunk || echo "Ignoring..."
354       - run:
355           name: Updating checkout
356           working_directory: /home/circleci/work/co
357           command: fossil update || echo "Ignoring..."
358       - run:
359           name: Ensure build is clean
360           working_directory: /home/circleci/work/co
361           command: ./gradlew clean --parallel
362       - run:
363           name: Run CI/CD Bundle Tasks
364           working_directory: /home/circleci/work/co
365           command: ./gradlew :tools:cicd-release-bundle:run --parallel
366       - run:
367           name: Run CI/CD Bundle Tasks (Retry)
368           working_directory: /home/circleci/work/co
369           command: ./gradlew :tools:cicd-release-bundle:run --parallel
370           when: on_fail
371       - run:
372           name: Close repository
373           working_directory: /home/circleci/work/co
374           command: fossil close --force
375           when: always
377   ################################## WINDOWS #################################
378   build_windows_i386_setup:
379     executor:
380       name: win/default
381       shell: cmd.exe
382       size: medium
383     steps:
384       - windows-install-jdk:
385           jdk-url: <<pipeline.parameters.windows-jdk-i386>>
387   build_windows_i386:
388     executor:
389       name: win/default
390       shell: cmd.exe
391       size: medium
392     environment:
393       # Use older JDK for CircleCI
394       JAVA_HOME: c:/users/circleci/project/<<pipeline.parameters.windows-jdk-base-dir>>/
395     steps:
396       - checkout
397       - attach_workspace:
398           at: .
399       - windows-install-required
400       - run:
401           shell: cmd.exe
402           name: Gradle Build and Test
403           # According to documentation, Gradle on Windows has trouble and tries
404           # to make way too many workers which causes extreme resource.
405           # contention --max-workers=2
406           command: gradlew <<pipeline.parameters.standard-build-options>> <<pipeline.parameters.standard-exclusion>> <<pipeline.parameters.standard-gradle-options>>
407           no_output_timeout: 60m
408       - run:
409           shell: cmd.exe
410           name: Gradle Build and Test (Retry)
411           command: gradlew <<pipeline.parameters.standard-build-options>> <<pipeline.parameters.standard-exclusion>> <<pipeline.parameters.standard-gradle-options>>
412           no_output_timeout: 60m
413           when: on_fail
414       - persist-gradle
415       - save-test-results:
416           where: "vm-test-hosted-debug"
417           os: "windows"
418           vm: "hosted"
419           shell: bash.exe
420           find: /usr/bin/find
421           home: "/c/users/circleci/"
422           store-home: "c:/users/circleci/"
423       - save-test-results:
424           where: "vm-test-hosted-release"
425           os: "windows"
426           vm: "hosted"
427           shell: bash.exe
428           find: /usr/bin/find
429           home: "/c/users/circleci/"
430           store-home: "c:/users/circleci/"
432   build_windows_i386_standalone:
433     executor:
434       name: win/default
435       shell: cmd.exe
436       size: medium
437     environment:
438       # Use older JDK for CircleCI
439       JAVA_HOME: c:/users/circleci/project/<<pipeline.parameters.windows-jdk-base-dir>>/
440     steps:
441       - checkout
442       - attach_workspace:
443           at: .
444       - windows-install-required
445       - run:
446           shell: bash.exe
447           name: Construct Standalone
448           command: ./gradlew :emulators:standalone:shadowJar <<pipeline.parameters.standard-gradle-options >>
449       - run:
450           name: Construct Standalone (Retry)
451           shell: bash.exe
452           command: ./gradlew :emulators:standalone:shadowJar <<pipeline.parameters.standard-gradle-options >>
453           when: on_fail
454       - run:
455           shell: bash.exe
456           name: Remove distracting JAR, if any
457           command: rm emulators/standalone/build/libs/standalone-*.jar
458       - store_artifacts:
459           path: emulators/standalone/build/libs/
460           destination: .
462   build_windows_amd64_setup:
463     executor:
464       name: win/default
465       shell: cmd.exe
466       size: medium
467     environment:
468       # Use older JDK for CircleCI
469       JAVA_HOME: c:/users/circleci/project/<<pipeline.parameters.windows-jdk-base-dir>>/
470     steps:
471       - windows-install-jdk:
472           jdk-url: <<pipeline.parameters.windows-jdk-amd64>>
474   build_windows_amd64:
475     executor:
476       name: win/default
477       shell: cmd.exe
478       size: medium
479     environment:
480       # Use a reduced amount of memory to all the VMs so that it does not
481       # try grabbing all the memory that is available to the system.
482       JAVA_OPTS: -Xmx3g
484       # Use older JDK for CircleCI
485       JAVA_HOME: c:/users/circleci/project/<<pipeline.parameters.windows-jdk-base-dir>>/
486     steps:
487       - checkout
488       - attach_workspace:
489           at: .
490       - windows-install-required
491       - run:
492           name: Gradle Build and Test
493           shell: cmd.exe
494           # According to documentation, Gradle on Windows has trouble and tries
495           # to make way too many workers which causes extreme resource.
496           # contention --max-workers=2
497           command: gradlew <<pipeline.parameters.standard-build-options>> <<pipeline.parameters.standard-exclusion>> <<pipeline.parameters.standard-gradle-options>>
498           no_output_timeout: 60m
499       - run:
500           name: Gradle Build and Test (Retry)
501           shell: cmd.exe
502           command: gradlew <<pipeline.parameters.standard-build-options>> <<pipeline.parameters.standard-exclusion>> <<pipeline.parameters.standard-gradle-options>>
503           no_output_timeout: 60m
504           when: on_fail
505       - persist-gradle
506       - save-test-results:
507           where: "vm-test-hosted-debug"
508           os: "windows"
509           vm: "hosted"
510           shell: bash.exe
511           find: /usr/bin/find
512           home: "/c/users/circleci/"
513           store-home: "c:/users/circleci/"
514       - save-test-results:
515           where: "vm-test-hosted-release"
516           os: "windows"
517           vm: "hosted"
518           shell: bash.exe
519           find: /usr/bin/find
520           home: "/c/users/circleci/"
521           store-home: "c:/users/circleci/"
523   build_windows_amd64_standalone:
524     executor:
525       name: win/default
526       shell: cmd.exe
527       size: medium
528     environment:
529       # Use a reduced amount of memory to all the VMs so that it does not
530       # try grabbing all the memory that is available to the system.
531       JAVA_OPTS: -Xmx3g
533       # Use older JDK for CircleCI
534       JAVA_HOME: c:/users/circleci/project/<<pipeline.parameters.windows-jdk-base-dir>>/
535     steps:
536       - checkout
537       - attach_workspace:
538           at: .
539       - windows-install-required
540       - run:
541           name: Construct Standalone
542           shell: bash.exe
543           command: ./gradlew :emulators:standalone:shadowJar <<pipeline.parameters.standard-gradle-options >>
544       - run:
545           name: Construct Standalone (Retry)
546           shell: bash.exe
547           command: ./gradlew :emulators:standalone:shadowJar <<pipeline.parameters.standard-gradle-options >>
548           when: on_fail
549       - run:
550           shell: bash.exe
551           name: Remove distracting JAR, if any
552           command: rm emulators/standalone/build/libs/standalone-*.jar
553       - store_artifacts:
554           path: emulators/standalone/build/libs/
555           destination: .
557   ################################# MAC OS X #################################
558   build_macosx_amd64:
559     executor: build-on-macos
560     steps:
561       - checkout
562       - run:
563           name: Gradle Build and Test
564           command: timeout --foreground 60m ./gradlew <<pipeline.parameters.standard-build-options>> <<pipeline.parameters.standard-exclusion>> <<pipeline.parameters.standard-gradle-options>>
565           no_output_timeout: 60m
566       - run:
567           name: Gradle Build and Test (Retry)
568           command: timeout --foreground 60m ./gradlew <<pipeline.parameters.standard-build-options>> <<pipeline.parameters.standard-exclusion>> <<pipeline.parameters.standard-gradle-options>>
569           no_output_timeout: 60m
570           when: on_fail
571       - persist-gradle
572       - save-test-results:
573           where: "vm-test-hosted-debug"
574           os: "macosx"
575           vm: "hosted"
576       - save-test-results:
577           where: "vm-test-hosted-release"
578           os: "macosx"
579           vm: "hosted"
580   build_macosx_arm64:
581     executor: build-on-macos-m1
582     steps:
583       - checkout
584       - run:
585           name: Gradle Build and Test
586           command: timeout --foreground 60m ./gradlew <<pipeline.parameters.standard-build-options>> <<pipeline.parameters.standard-exclusion>> <<pipeline.parameters.standard-gradle-options>>
587           no_output_timeout: 60m
588       - run:
589           name: Gradle Build and Test (Retry)
590           command: timeout --foreground 60m ./gradlew <<pipeline.parameters.standard-build-options>> <<pipeline.parameters.standard-exclusion>> <<pipeline.parameters.standard-gradle-options>>
591           no_output_timeout: 60m
592           when: on_fail
593       - persist-gradle
594       - save-test-results:
595           where: "vm-test-hosted-debug"
596           os: "macosx-m1"
597           vm: "hosted"
598       - save-test-results:
599           where: "vm-test-hosted-release"
600           os: "macosx-m1"
601           vm: "hosted"
603   build_macosx_amd64_standalone:
604     executor: build-on-macos
605     steps:
606       - checkout
607       - attach_workspace:
608           at: .
609       - standalone-unix-common-build
610   build_macosx_aarch64_standalone:
611     executor: build-on-macos-m1
612     steps:
613       - checkout
614       - attach_workspace:
615           at: .
616       - standalone-unix-common-build
618   ################################### LINUX ##################################
619   # Linux AMD64
620   build_linux_amd64:
621     executor: build-on-linux-amd64
622     steps:
623       - checkout
624       - linux-install-required
625       - run:
626           name: Gradle Build and Test
627           command: timeout --foreground 60m ./gradlew <<pipeline.parameters.standard-build-options>> <<pipeline.parameters.standard-exclusion>> <<pipeline.parameters.standard-gradle-options>>
628           no_output_timeout: 60m
629       - run:
630           name: Gradle Build and Test (Retry)
631           command: timeout --foreground 60m ./gradlew <<pipeline.parameters.standard-build-options>> <<pipeline.parameters.standard-exclusion>> <<pipeline.parameters.standard-gradle-options>>
632           no_output_timeout: 60m
633           when: on_fail
634       - save-test-results:
635           where: "vm-test-hosted-debug"
636           os: "linux-amd64"
637           vm: "hosted"
638       - save-test-results:
639           where: "vm-test-hosted-release"
640           os: "linux-amd64"
641           vm: "hosted"
642       - persist-gradle
643   build_linux_amd64_standalone:
644     executor: build-on-linux-amd64
645     steps:
646       - checkout
647       - linux-install-required
648       - attach_workspace:
649           at: .
650       - standalone-unix-common-build
651   build_linux_amd64_standalone_flatpak:
652     executor: build-on-linux-amd64
653     steps:
654       - checkout
655       - linux-install-required
656       - flatpak-install-required
657       - flatpak-common-build:
658           arch: amd64
660   # Linux ARM64
661   build_linux_arm64:
662     executor: build-on-linux-arm64
663     steps:
664       - checkout
665       - linux-install-required
666       - run:
667           name: Gradle Build and Test
668           command: timeout --foreground 60m ./gradlew <<pipeline.parameters.standard-build-options>> <<pipeline.parameters.standard-exclusion>> <<pipeline.parameters.standard-gradle-options>>
669           no_output_timeout: 60m
670       - run:
671           name: Gradle Build and Test (Retry)
672           command: timeout --foreground 60m ./gradlew <<pipeline.parameters.standard-build-options>> <<pipeline.parameters.standard-exclusion>> <<pipeline.parameters.standard-gradle-options>>
673           no_output_timeout: 60m
674           when: on_fail
675       - save-test-results:
676           where: "vm-test-hosted-debug"
677           os: "linux-arm64"
678           vm: "hosted"
679       - save-test-results:
680           where: "vm-test-hosted-release"
681           os: "linux-arm64"
682           vm: "hosted"
683       - persist-gradle
684   build_linux_aarch64_standalone:
685     executor: build-on-linux-arm64
686     steps:
687       - checkout
688       - linux-install-required
689       - attach_workspace:
690           at: .
691       - standalone-unix-common-build
692   build_linux_aarch64_standalone_flatpak:
693     executor: build-on-linux-arm64
694     steps:
695       - checkout
696       - linux-install-required
697       - flatpak-install-required
698       - flatpak-common-build:
699           arch: arm64
701   # Linux RISC-V 64-bit
702   build_linux_riscv64:
703     executor: build-on-linux-riscv64
704     steps:
705       - checkout
706       - run:
707           name: Gradle Build and Test
708           command: timeout --foreground 120m ./gradlew <<pipeline.parameters.standard-build-options>> <<pipeline.parameters.standard-exclusion>> <<pipeline.parameters.standard-gradle-options>>
709           no_output_timeout: 120m
710       - run:
711           name: Gradle Build and Test (Retry)
712           command: timeout --foreground 120m ./gradlew <<pipeline.parameters.standard-build-options>> <<pipeline.parameters.standard-exclusion>> <<pipeline.parameters.standard-gradle-options>>
713           no_output_timeout: 120m
714           when: on_fail
715       - save-test-results:
716           where: "vm-test-hosted-debug"
717           os: "linux-arm64"
718           vm: "hosted"
719       - save-test-results:
720           where: "vm-test-hosted-release"
721           os: "linux-arm64"
722           vm: "hosted"
723       - persist-gradle
724   build_linux_riscv64_standalone:
725     executor: build-on-linux-riscv64
726     steps:
727       - checkout
728       - attach_workspace:
729           at: .
730       - standalone-unix-common-build
732   ### OSS SonaType Nexus
733   sonatype_publish:
734     executor: build-on-linux-amd64
735     steps:
736       - checkout
737       - linux-install-required
738       - attach_workspace:
739           at: .
740       - run:
741           name: Publish to OSS SonaType
742           command: ./gradlew publishMavenPublicationToMavenRepository <<pipeline.parameters.standard-gradle-options>> || circleci-agent step halt
744   ### SpringCoat
745   test_springcoat_debug:
746     executor: build-on-linux-amd64
747     steps:
748       - checkout
749       - linux-install-required
750       - attach_workspace:
751           at: .
752       - run:
753           name: SpringCoat Tests
754           command: timeout --foreground 60m ./gradlew testSpringCoatDebug <<pipeline.parameters.standard-gradle-options>>
755           no_output_timeout: 60m
756       - save-test-results:
757           where: "vm-test-springcoat-debug"
758           os: "linux"
759           vm: "springcoat"
760   test_springcoat_release:
761     executor: build-on-linux-amd64
762     steps:
763       - checkout
764       - linux-install-required
765       - attach_workspace:
766           at: .
767       - run:
768           name: SpringCoat Tests
769           command: timeout --foreground 60m ./gradlew testSpringCoatRelease <<pipeline.parameters.standard-gradle-options>>
770           no_output_timeout: 60m
771       - save-test-results:
772           where: "vm-test-springcoat-release"
773           os: "linux"
774           vm: "springcoat"
776   ################################### USERS ##################################
777   export_user_guide:
778     executor: build-on-linux-amd64
779     steps:
780       - checkout
781       - linux-install-required
782       - run:
783           name: Checkout Wiki
784           command: git clone git@github.com:SquirrelJME/SquirrelJME.wiki.git /tmp/wiki
785       - run:
786           name: Wikify
787           command: .circleci/squirreljme-wikify-user-guide.sh "$(pwd)" "/tmp/wiki"
788       - run:
789           name: Update Git User
790           command: |
791             cd "/tmp/wiki" && git config user.name "SquirrelJME Automation" && git config user.email "xerthesquirrel+squirreljme@gmail.com"
792       - run:
793           name: Commit changes
794           command: |
795             cd "/tmp/wiki" && git commit -m "Synchronize User-Guide" || echo "Ignoring commit."
796       - add_ssh_keys:
797           fingerprints:
798             - "26:b8:ae:4d:53:64:4c:6a:59:3d:a6:60:44:90:9d:6c"
799       - run:
800           name: Push changes
801           command: |
802             cd "/tmp/wiki" && git push
804   ################################ CONSTRUCTION ###############################
805   # Runs the `testJar` task so any operations following this will run faster
806   # when they need to use these JARs
807   construct_testJars:
808     executor: build-on-linux-amd64
809     steps:
810       - checkout
811       - linux-install-required
812       - attach_workspace:
813           at: .
814       - run:
815           name: Construct Test JARs
816           command: ./gradlew testJar <<pipeline.parameters.standard-gradle-options>>
817       - persist-gradle
819 workflows:
820   version: 2
821   tests:
822     jobs:
823       ############################# STANDARD TESTS ############################
824       # AMD64
825       - build_linux_amd64
826       - test_springcoat_debug:
827           requires:
828             - construct_testJars
829           filters:
830             branches:
831               only:
832                 - trunk
833       - test_springcoat_release:
834           requires:
835             - construct_testJars
836           filters:
837             branches:
838               only:
839                 - trunk
840       - build_linux_amd64_standalone:
841           requires:
842             - build_linux_amd64
843           filters:
844             branches:
845               only:
846                 - trunk
847       - build_linux_amd64_standalone_flatpak:
848           requires:
849             - build_linux_amd64
850           filters:
851             branches:
852               only:
853                 - trunk
855       # ARM64
856       - build_linux_arm64:
857           filters:
858             branches:
859               only:
860                 - trunk
861       - build_linux_aarch64_standalone:
862           requires:
863             - build_linux_arm64
864           filters:
865             branches:
866               only:
867                 - trunk
868       - build_linux_aarch64_standalone_flatpak:
869           requires:
870             - build_linux_arm64
871           filters:
872             branches:
873               only:
874                 - trunk
876       # RISC-V 64-bit
877 #      - build_linux_riscv64
878 #      - build_linux_riscv64_standalone:
879 #          requires:
880 #            - build_linux_riscv64
881 #          filters:
882 #            branches:
883 #              only:
884 #                - trunk
886       # Windows 32-bit
887       - build_windows_i386_setup:
888           filters:
889             branches:
890               only:
891                 - trunk
892       - build_windows_i386:
893           requires:
894             - build_windows_i386_setup
895           filters:
896             branches:
897               only:
898                 - trunk
899       - build_windows_i386_standalone:
900           requires:
901             - build_windows_i386
902           filters:
903             branches:
904               only:
905                 - trunk
907       # Windows 64-bit
908       - build_windows_amd64_setup
909       - build_windows_amd64:
910           requires:
911             - build_windows_amd64_setup
912       - build_windows_amd64_standalone:
913           requires:
914             - build_windows_amd64
915           filters:
916             branches:
917               only:
918                 - trunk
920       # Mac OS X runs decently however the jobs for it have a higher cost, so
921       # only perform builds and tests for trunk to lower costs.
922       # Currently, I have an overabundance of credits...
923       - build_macosx_amd64
924       - build_macosx_arm64
925       - build_macosx_amd64_standalone:
926           requires:
927             - build_macosx_amd64
928           filters:
929             branches:
930               only:
931                 - trunk
932       - build_macosx_aarch64_standalone:
933           requires:
934             - build_macosx_arm64
935           filters:
936             branches:
937               only:
938                 - trunk
940       # Publishing to OSS Sonatype Nexus (https://oss.sonatype.org)
941       - sonatype_publish:
942           requires:
943             - build_linux_amd64
944           filters:
945             branches:
946               only:
947                 - trunk
948                 - wip-centralpublish
950       ###################### LIBRARY AND ROM CONSTRUCTION #####################
951       - construct_testJars:
952           requires:
953             - build_linux_amd64
954           filters:
955             branches:
956               only:
957                 - trunk
959       ############################## DEPLOYMENT ##############################
960       - bundle:
961           requires:
962             - build_linux_amd64_standalone
963             - build_linux_amd64_standalone_flatpak
964             - build_linux_aarch64_standalone_flatpak
965             - build_windows_i386_standalone
966             - build_windows_amd64_standalone
967             - build_macosx_amd64_standalone
968             - build_macosx_aarch64_standalone
969           filters:
970             branches:
971               only:
972                 - trunk
974   #################### TASKS TO INCREASE USER FRIENDLINESS ####################
975   friendliness:
976     jobs:
977       - export_user_guide:
978           filters:
979             branches:
980               only:
981                 - trunk
982                 - wip-userguide