Skip to content

Commit 877643b

Browse files
Run the workflow without a warning of its own
go.yml names git's default branch before each job's checkout, checks out with actions/checkout@v5 and sets up Go with actions/setup-go@v6. The test job removes the psql.1.gz alternative before it purges the runner's PostgreSQL, quotes the package names it builds from PGVERSION and POSTGISVERSION and the paths it appends to GITHUB_ENV, and counts the sample documents with find. Why. The CI log carried warnings from these steps, not from the tier's build: git's hint on every repository it initialises without a default branch, the Node 20 deprecation and DEP0040 for the punycode module, which the runner reports from actions/checkout@v4 and actions/setup-go@v5, and update-alternatives repairing the psql.1.gz link group of the PostgreSQL the provision step installs, whose man page is absent. actionlint reports the unquoted expansions (SC2086) and the ls count (SC2012). MobilityDB/JMEOS#217 and MobilityDB/MEOS-API#241 apply the same steps. Measured. In the log of run 42108524478 on master, the hint, the deprecation and the update-alternatives warning name these steps. actions/checkout v5.1.0 and actions/setup-go v6.5.0 run on node24. actionlint 1.7.12 reports no finding in go.yml, against 9 on master, and the find count reads the same 13 sample documents the ls count reads.
1 parent cafcd8f commit 877643b

1 file changed

Lines changed: 27 additions & 13 deletions

File tree

‎.github/workflows/go.yml‎

Lines changed: 27 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,14 @@ jobs:
1515
name: Build and vet, every tag
1616
runs-on: ubuntu-latest
1717
steps:
18-
- uses: actions/checkout@v4
18+
# git names the branch a repository it initialises starts on, so the checkout
19+
# prints no hint about an unset default.
20+
- name: Name git's default branch
21+
run: git config --global init.defaultBranch main
1922

20-
- uses: actions/setup-go@v5
23+
- uses: actions/checkout@v5
24+
25+
- uses: actions/setup-go@v6
2126
with:
2227
go-version-file: go.mod
2328
cache: true
@@ -110,10 +115,15 @@ jobs:
110115
# accounts for, because deleting a test is what a skip refusal cannot see.
111116
MFAPI_TEST_FLOOR: "150"
112117
steps:
113-
- uses: actions/checkout@v4
118+
# git names the branch a repository it initialises starts on, so the checkout
119+
# prints no hint about an unset default.
120+
- name: Name git's default branch
121+
run: git config --global init.defaultBranch main
122+
123+
- uses: actions/checkout@v5
114124

115125
- name: Check out MobilityDB master
116-
uses: actions/checkout@v4
126+
uses: actions/checkout@v5
117127
with:
118128
repository: MobilityDB/MobilityDB
119129
ref: master
@@ -125,7 +135,7 @@ jobs:
125135
git -C mobilitydb log -1 --format='MobilityDB master %H %s'
126136
echo "sha=$(git -C mobilitydb rev-parse HEAD)" >> "$GITHUB_OUTPUT"
127137
128-
- uses: actions/setup-go@v5
138+
- uses: actions/setup-go@v6
129139
with:
130140
go-version-file: go.mod
131141
cache: true
@@ -148,6 +158,10 @@ jobs:
148158
- name: Remove the runner's PostgreSQL, so apt.postgresql.org answers
149159
run: |
150160
sudo service postgresql stop || true
161+
# The PostgreSQL the provision step installs leaves its psql.1.gz
162+
# alternative pointing at nothing, so the package removal would repair
163+
# it with a warning; it goes first.
164+
sudo update-alternatives --remove-all psql.1.gz 2>/dev/null || true
151165
sudo apt-get --purge remove postgresql* -y || true
152166
sudo rm -rf /var/lib/postgresql/ /etc/postgresql/ /var/log/postgresql/ || true
153167
@@ -173,9 +187,9 @@ jobs:
173187
libxml2-dev \
174188
zlib1g-dev \
175189
autoconf automake libtool \
176-
postgresql-${PGVERSION} \
177-
postgresql-${PGVERSION}-postgis-${POSTGISVERSION} \
178-
postgresql-server-dev-${PGVERSION}
190+
"postgresql-${PGVERSION}" \
191+
"postgresql-${PGVERSION}-postgis-${POSTGISVERSION}" \
192+
"postgresql-server-dev-${PGVERSION}"
179193
180194
# WHAT ALL=ON REQUIRES, which is what lets the builds below ask for every
181195
# family. libh3 is the H3 family's library, and the vendored pgPointCloud
@@ -187,8 +201,8 @@ jobs:
187201
- name: Install what the optional families require
188202
run: |
189203
sudo apt-get install -y libh3-dev \
190-
postgresql-${PGVERSION}-pointcloud \
191-
postgresql-${PGVERSION}-h3
204+
"postgresql-${PGVERSION}-pointcloud" \
205+
"postgresql-${PGVERSION}-h3"
192206
193207
# The pgdg libh3-dev package layout differs between releases, so the
194208
# header and the library are located on disk and pinned rather than left
@@ -204,8 +218,8 @@ jobs:
204218
echo "::error::could not locate libh3 headers/library"
205219
exit 1
206220
fi
207-
echo "H3_INCLUDE_DIR=$(dirname "$H3_INC")" >> $GITHUB_ENV
208-
echo "H3_LIBRARY=$H3_LIB" >> $GITHUB_ENV
221+
echo "H3_INCLUDE_DIR=$(dirname "$H3_INC")" >> "$GITHUB_ENV"
222+
echo "H3_LIBRARY=$H3_LIB" >> "$GITHUB_ENV"
209223
210224
# ALL FAMILIES. A family left out is stripped at preprocess time, so this
211225
# job would report on a smaller MobilityDB than the one it names. The tier
@@ -295,6 +309,6 @@ jobs:
295309
fi
296310
done
297311
if [ "$rc" -eq 0 ]; then
298-
echo "$(ls samples/*.json | wc -l) sample documents are what the service writes"
312+
echo "$(find samples -maxdepth 1 -name '*.json' | wc -l) sample documents are what the service writes"
299313
fi
300314
exit $rc

0 commit comments

Comments
 (0)