Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attempt windows CI #69

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 32 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
# To manually manage the CircleCI configuration for this project, remove the .circleci/template.sh file.

version: 2.1
orbs:
win: circleci/[email protected] # https://circleci.com/orbs/registry/orb/circleci/windows
jobs:

check:
Expand Down Expand Up @@ -84,6 +86,32 @@ jobs:
- store_test_results: { path: ~/junit }
- store_artifacts: { path: ~/artifacts }

windows:
executor: win/default
environment:
JAVA_HOME: C:\Program Files\Zulu\zulu-11
# CIRCLE_TEST_REPORTS: C:\Users\circleci\junit
# CIRCLE_ARTIFACTS: C:\Users\circleci\artifacts
steps:
- run: |
New-Item -ItemType "directory" -Path "C:\Users\circleci\junit", "C:\Users\circleci\artifacts"
choco install zulu11
$Env:JAVA_HOME = "C:\Program Files\Zulu\zulu-11"
echo $Env:JAVA_HOME
# Avoid default git behavior of transforming \n to \r\n on windows
- run: git config --global core.autocrlf false
- checkout
- restore_cache: { key: 'windows-gradle-wrapper-v1-{{ checksum "gradle/wrapper/gradle-wrapper.properties" }}' }
- restore_cache: { key: 'windows-dependencies-v1-{{ checksum "versions.props" }}-{{ checksum "build.gradle" }}' }
- run: ./gradlew.bat build --no-daemon --stacktrace
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

due to:

* What went wrong:
Task '.gradle.java.installations.fromEnv=JAVA_8_HOME,JAVA_11_HOME,JAVA_15_HOME,JAVA_17_HOME,JAVA_HOME' not found in root project 'gradle-jdks-root'.

- save_cache:
key: 'windows-dependencies-v1-{{ checksum "versions.props" }}-{{ checksum "build.gradle" }}'
paths: [ C:\Users\circleci\.gradle\caches ]
- save_cache:
key: 'windows-gradle-wrapper-v1-{{ checksum "gradle/wrapper/gradle-wrapper.properties" }}'
paths: [ C:\Users\circleci\.gradle\wrapper ]
# - store_test_results: { path: C:\Users\circleci\junit }
# - store_artifacts: { path: C:\Users\circleci\artifacts }
trial-publish:
docker: [{ image: 'cimg/openjdk:11.0.10-node' }]
resource_class: medium
Expand Down Expand Up @@ -164,9 +192,12 @@ workflows:
- build:
filters: { tags: { only: /.*/ } }

- windows:
filters: { tags: { only: /.*/ } }

- trial-publish:
filters: { branches: { ignore: develop } }

- publish:
requires: [ check, build, trial-publish ]
requires: [ check, build, windows, trial-publish ]
filters: { tags: { only: /.*/ }, branches: { only: develop } }
1 change: 1 addition & 0 deletions .circleci/template.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
export CIRCLECI_TEMPLATE=java-library-oss
export JDK=11
export DOCKER_TESTS=true
export WINDOWS=true
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ buildscript {
}

dependencies {
classpath 'com.palantir.gradle.jdks:gradle-jdks:0.16.0'
classpath 'com.palantir.gradle.jdks:gradle-jdks:0.18.0'
classpath 'com.palantir.gradle.jdkslatest:gradle-jdks-latest:0.1.0'
classpath 'org.unbroken-dome.gradle-plugins:gradle-testsets-plugin:4.0.0'
classpath 'com.palantir.gradle.externalpublish:gradle-external-publish-plugin:1.11.0'
Expand Down