Skip to content

Commit

Permalink
Reset Powershell environment
Browse files Browse the repository at this point in the history
We need to reset Powershell environment since it is inherited from the runner process.
For that, we use the chocolatey helper script that needs to be imported
and called.
We also make sure that JAVA_HOME is set properly to the one set up by the setup-java action
and other predefined Registry values do not interfere.
  • Loading branch information
puskarpeter committed Apr 25, 2024
1 parent 6484239 commit 0b8ec97
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/master-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,14 @@ jobs:

- name: Build with maven
run: ./mvnw --no-transfer-progress verify
if: matrix.os != 'windows-latest'

- name: Build with maven
run: |
$step_java_home=$env:JAVA_HOME
Import-Module "$env:ChocolateyInstall/helpers/chocolateyInstaller.psm1"
refreshenv
$env:JAVA_HOME=$step_java_home
./mvnw --no-transfer-progress verify
shell: pwsh
if: matrix.os == 'windows-latest'

0 comments on commit 0b8ec97

Please sign in to comment.