Skip to content

Commit

Permalink
feat: Update CI Window Machine (#289)
Browse files Browse the repository at this point in the history
* feat: update ci windows image and java selection

* feat: update test to check gradle version
  • Loading branch information
DOlufemi authored Sep 12, 2024
1 parent b4c107b commit 628c688
Show file tree
Hide file tree
Showing 4 changed files with 616 additions and 568 deletions.
31 changes: 25 additions & 6 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: 2.1

orbs:
node: circleci/[email protected]
win: circleci/windows@2.4.0
win: circleci/windows@5.0.0
prodsec: snyk/prodsec-orb@1

defaults: &defaults
Expand All @@ -13,6 +13,9 @@ defaults: &defaults
jdk_version:
type: string
default: ''
jdk_path:
type: string
default: ''
node_version:
type: string
default: ''
Expand Down Expand Up @@ -43,13 +46,15 @@ test_matrix_win: &test_matrix_win
parameters:
node_version: [ '16', '18', '20' ]
jdk_version: [ '8' ]
jdk_path: [ 'C:\Program Files\Eclipse Adoptium\jdk-8.0.422.5-hotspot' ]
gradle_version: [ '4.10', '5.5', '6.2.1' ]

test_matrix_win_new_versions: &test_matrix_win_new_versions
matrix:
parameters:
node_version: [ '16', '18', '20' ]
jdk_version: [ '17' ]
jdk_version: [ '17.0.2' ]
jdk_path: [ 'C:\Program Files\OpenJDK\jdk-17.0.2' ]
gradle_version: [ '7.3', '8.4' ]

filters_branches_only_main: &filters_branches_only_main
Expand Down Expand Up @@ -99,7 +104,7 @@ commands:
- chocolatey-gradle-cache-{{ arch }}-v3
- run:
name: Installing Gradle
command: choco install gradle --version=<< parameters.gradle_version >> --cache ~\AppData\Local\Temp\gradle
command: choco install -y gradle --version=<< parameters.gradle_version >> --cache ~\AppData\Local\Temp\gradle
- save_cache:
key: chocolatey-gradle-cache-{{ arch }}-v3
paths:
Expand Down Expand Up @@ -179,7 +184,12 @@ commands:
- chocolatey-jdk-cache-{{ arch }}-v4
- run:
name: Installing JDK
command: choco install openjdk<< parameters.jdk_version >> --cache ~\AppData\Local\Temp\jdk
command: |
if [[ << parameters.jdk_version >> == "8" ]]; then
choco install -y openjdk<< parameters.jdk_version >> --cache ~\AppData\Local\Temp\jdk
else
choco install --force -y openjdk --version=<< parameters.jdk_version >> --cache ~\AppData\Local\Temp\jdk
fi
- save_cache:
key: chocolatey-jdk-cache-{{ arch }}-v4
paths:
Expand Down Expand Up @@ -219,6 +229,7 @@ jobs:
<<: *windows_defaults
environment:
JDK: << parameters.jdk_version >>
# JAVA_HOME: << parameters.jdk_path >>
npm_config_loglevel: silent
GRADLE_OPTS: '-Dorg.gradle.daemon=false -Dorg.gradle.daemon.idletimeout=180000 -Xmx3g -XX:+HeapDumpOnOutOfMemoryError -Dkotlin.compiler.execution.strategy=in-process'
JAVA_OPTS: ' -Xmx512M -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8'
Expand All @@ -235,7 +246,15 @@ jobs:
- node-install-packages
- run:
name: Run tests
command: npm test
command: |
export JAVA_HOME="<< parameters.jdk_path >>"
export PATH=$JAVA_HOME/bin:$PATH
if [[ << parameters.jdk_version >> == "8" ]]; then
java -version
else
java --version
fi
npm test
test-unix:
<<: *defaults
Expand Down Expand Up @@ -330,4 +349,4 @@ workflows:
name: Release
context: nodejs-app-release
node_version: '20.9'
<<: *filters_branches_only_main
<<: *filters_branches_only_main
2 changes: 1 addition & 1 deletion lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ function getVersionBuildInfo(
}
}

async function getGradleVersion(
export async function getGradleVersion(
root: string,
command: string,
): Promise<string> {
Expand Down
30 changes: 15 additions & 15 deletions test/fixtures-with-wrappers/with-lock-file/dep-graph.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
}
},
{
"id": "com.google.guava:guava@33.0.0-jre",
"id": "com.google.guava:guava@33.3.0-jre",
"info": {
"name": "com.google.guava:guava",
"version": "33.0.0-jre"
"version": "33.3.0-jre"
}
},
{
Expand Down Expand Up @@ -54,17 +54,17 @@
}
},
{
"id": "org.checkerframework:checker-qual@3.41.0",
"id": "org.checkerframework:checker-qual@3.43.0",
"info": {
"name": "org.checkerframework:checker-qual",
"version": "3.41.0"
"version": "3.43.0"
}
},
{
"id": "com.google.errorprone:error_prone_annotations@2.23.0",
"id": "com.google.errorprone:error_prone_annotations@2.28.0",
"info": {
"name": "com.google.errorprone:error_prone_annotations",
"version": "2.23.0"
"version": "2.28.0"
}
},
{
Expand Down Expand Up @@ -107,7 +107,7 @@
"nodeId": "org.codehaus.groovy:[email protected]"
},
{
"nodeId": "com.google.guava:guava@33.0.0-jre"
"nodeId": "com.google.guava:guava@33.3.0-jre"
},
{
"nodeId": "com.google.guava:[email protected]"
Expand All @@ -120,8 +120,8 @@
"deps": []
},
{
"nodeId": "com.google.guava:guava@33.0.0-jre",
"pkgId": "com.google.guava:guava@33.0.0-jre",
"nodeId": "com.google.guava:guava@33.3.0-jre",
"pkgId": "com.google.guava:guava@33.3.0-jre",
"deps": [
{
"nodeId": "com.google.guava:[email protected]"
Expand All @@ -133,10 +133,10 @@
"nodeId": "com.google.code.findbugs:[email protected]"
},
{
"nodeId": "org.checkerframework:checker-qual@3.41.0"
"nodeId": "org.checkerframework:checker-qual@3.43.0"
},
{
"nodeId": "com.google.errorprone:error_prone_annotations@2.23.0"
"nodeId": "com.google.errorprone:error_prone_annotations@2.28.0"
}
]
},
Expand Down Expand Up @@ -180,13 +180,13 @@
"deps": []
},
{
"nodeId": "org.checkerframework:checker-qual@3.41.0",
"pkgId": "org.checkerframework:checker-qual@3.41.0",
"nodeId": "org.checkerframework:checker-qual@3.43.0",
"pkgId": "org.checkerframework:checker-qual@3.43.0",
"deps": []
},
{
"nodeId": "com.google.errorprone:error_prone_annotations@2.23.0",
"pkgId": "com.google.errorprone:error_prone_annotations@2.23.0",
"nodeId": "com.google.errorprone:error_prone_annotations@2.28.0",
"pkgId": "com.google.errorprone:error_prone_annotations@2.28.0",
"deps": []
},
{
Expand Down
Loading

0 comments on commit 628c688

Please sign in to comment.