Skip to content

Commit 9798ef3

Browse files
committed
Well, that was unexpected
It seemed the old setup-java version installed a JDK for x64? And it worked? But causes the linking step to complain a bunch of PostgreSQL symbols can't be found ... for x86_64? This should correctly find the mixed-case JAVA_HOME_* variables. Also using newer versions of setup-java and checkout actions.
1 parent 0542c7d commit 9798ef3

File tree

1 file changed

+20
-7
lines changed

1 file changed

+20
-7
lines changed

.github/workflows/ci-lazypg.yml

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,20 +46,32 @@ jobs:
4646
env:
4747
JAVAVER: ${{ matrix.java }}
4848
run: |
49-
candidate="JAVA_HOME_${JAVAVER}_${RUNNER_ARCH}"
50-
if [[ -n ${!candidate+set} ]]
49+
if
50+
candidate="JAVA_HOME_${JAVAVER}_${RUNNER_ARCH}"
51+
echo -n "Environment contains $candidate? "
52+
[[ -n ${!candidate+set} ]]
5153
then
54+
echo yes
55+
echo >>"$GITHUB_ENV" "JAVA_HOME=${!candidate}"
56+
echo >>"$GITHUB_OUTPUT" java_found=true
57+
elif
58+
candidate="JAVA_HOME_${JAVAVER}_${RUNNER_ARCH,,[A-Z]}"
59+
echo -ne 'no\n'"Environment contains $candidate? "
60+
[[ -n ${!candidate+set} ]]
61+
then
62+
echo yes
5263
echo >>"$GITHUB_ENV" "JAVA_HOME=${!candidate}"
5364
echo >>"$GITHUB_OUTPUT" java_found=true
5465
else
66+
echo -e 'no\n'"only: ${!JAVA_HOME_*}"
5567
echo >>"$GITHUB_OUTPUT" java_found=false
56-
echo "Did not find ${candidate}, only: ${!JAVA_HOME_*}"
5768
fi
5869
59-
- name: Set up JDK
70+
- name: Fetch a JDK
6071
if: ${{ 'false' == steps.jdkcheck.outputs.java_found }}
61-
uses: actions/setup-java@v1
72+
uses: actions/setup-java@7a6d8a8234af8eb26422e24e3006232cccaa061b
6273
with:
74+
distrubution: temurin
6375
java-version: ${{ matrix.java }}
6476

6577
- name: Compute absolute paths for java and jshell
@@ -92,7 +104,8 @@ jobs:
92104
echo '::endgroup::'
93105
echo "::group::brew install postgresql@$PGVER"
94106
# HOMEBREW_GITHUB_ACTIONS will suppress the formula's initdb
95-
HOMEBREW_GITHUB_ACTIONS=1 brew install postgresql@"$PGVER"
107+
HOMEBREW_GITHUB_ACTIONS=1 HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1 \
108+
brew install postgresql@"$PGVER"
96109
echo '::endgroup::'
97110
pfx=$(brew --prefix postgresql@"$PGVER")
98111
echo >>"$GITHUB_ENV" PGCONFIG="$pfx/bin/pg_config"
@@ -153,7 +166,7 @@ jobs:
153166
print('PostgreSQL development files are present:', vers, sep='\n')
154167
155168
- name: Check out PL/Java
156-
uses: actions/checkout@v2
169+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
157170
with:
158171
path: pljava
159172

0 commit comments

Comments
 (0)