Skip to content

Commit c675963

Browse files
authored
ci: fix shell script issues reported by actionlint (#24168)
1 parent 2f7cf4d commit c675963

19 files changed

+59
-49
lines changed

.github/workflows/bootstrapping_ci.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ jobs:
4848
run: |
4949
ls -la v vc/v.c
5050
./v -os cross -o vc/v.c cmd/v
51+
# shellcheck disable=SC2086
5152
cc -o v_from_vc vc/v.c $B_LFLAGS
5253
ls -lart v_from_vc
5354
./v_from_vc version
@@ -59,6 +60,7 @@ jobs:
5960
ls -la v vc/v.c v_from_vc v_from_vc_produced_native_v
6061
./v_from_vc_produced_native_v -os cross -o vc/v.c cmd/v
6162
### do it a second time, just in case:
63+
# shellcheck disable=SC2086
6264
clang -o v_from_vc2 vc/v.c $B_LFLAGS
6365
ls -lart v_from_vc2
6466
./v_from_vc2 version
@@ -84,8 +86,8 @@ jobs:
8486
| jq -r '.workflow_runs[4].head_sha')
8587
echo "recent_good_commit=$recent_good_commit"
8688
# Build oldv at recent_good_commit.
87-
./v run cmd/tools/oldv.v -v $recent_good_commit
88-
cd ~/.cache/oldv/v_at_$recent_good_commit
89+
./v run cmd/tools/oldv.v -v "$recent_good_commit"
90+
cd "$HOME/.cache/oldv/v_at_$recent_good_commit"
8991
# Test updating
9092
./v version && ./v -v up && ./v version
9193
./v -o v2 cmd/v && ./v2 -o v3 cmd/v

.github/workflows/c2v_ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ jobs:
125125
id: compare
126126
continue-on-error: true
127127
run: |
128-
Xvfb $DISPLAY -screen 0 800x600x24 -fbdir /var/tmp/ &
128+
Xvfb "$DISPLAY" -screen 0 800x600x24 -fbdir /var/tmp/ &
129129
sleep 2; while [ ! -f /var/tmp/Xvfb_screen0 ]; do sleep 0.5; done # give xvfb time to start, even on slow CI runs
130130
sleep 5; v gret -r ~/code/doom -t ./doom-regression-images/vgret.doom.toml -v ./doom-sample_images ./doom-regression-images
131131
- name: Upload regression to imgur

.github/workflows/cross_ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ jobs:
7070
- name: Show diagnostics for wine
7171
run: |
7272
which wine
73+
# shellcheck disable=SC2046
7374
ls -la $(realpath $(which wine))
7475
7576
- name: v.c can be compiled and run with -os cross

.github/workflows/docker_ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,10 @@ jobs:
6767
- name: Checkout
6868
uses: actions/checkout@v4
6969
- name: Build V
70-
run: echo $VFLAGS && make -j4 && ./v -cg -o v cmd/v
70+
run: echo "$VFLAGS" && make -j4 && ./v -cg -o v cmd/v
7171
- name: Verify `v test` works
7272
run: |
73-
echo $VFLAGS
73+
echo "$VFLAGS"
7474
./v cmd/tools/test_if_v_test_system_works.v
7575
./cmd/tools/test_if_v_test_system_works
7676
- name: Add dependencies

.github/workflows/docs_ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,5 @@ jobs:
5454

5555
- name: Check against parent commit
5656
run: |
57+
# shellcheck disable=SC2086
5758
./v missdoc $MOPTIONS pv/vlib vlib

.github/workflows/gen_vc_ci.yml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,13 @@ jobs:
3939
git config --global user.email "vlang-bot@users.noreply.github.com"
4040
git config --global user.name "vlang-bot"
4141
42-
COMMIT_HASH=$(git rev-parse HEAD)
43-
COMMIT_MSG=$(git log -1 --oneline --pretty='%s' HEAD)
42+
COMMIT_HASH="$(git rev-parse HEAD)"
43+
COMMIT_MSG="$(git log -1 --oneline --pretty='%s' HEAD)"
4444
4545
rm -rf vc
46-
./v retry -- git clone --depth=1 \
47-
https://vlang-bot:${{ secrets.VLANG_BOT_SECRET }}@github.com/vlang/vc.git
46+
./v retry -- git clone --depth=1 "https://vlang-bot:${{ secrets.VLANG_BOT_SECRET }}@github.com/vlang/vc.git"
4847
4948
rm -rf vc/v.c vc/v_win.c
50-
5149
./v -o vc/v.c -cross cmd/v
5250
./v -o vc/v_win.c -os windows -cc msvc cmd/v
5351
@@ -58,9 +56,9 @@ jobs:
5856
grep 'Turned ON custom defines: no_backtrace,cross' vc/v.c
5957
grep '#define CUSTOM_DEFINE_cross' vc/v.c
6058
61-
# ensure the C files are over 5000 lines long, as a safety measure
62-
[ $(wc -l < vc/v.c) -gt 5000 ]
63-
[ $(wc -l < vc/v_win.c) -gt 5000 ]
59+
# ensure the generated C files for the compiler, are over 5000 lines long, as a safety measure
60+
[ "$(wc -l < vc/v.c)" -gt 5000 ]
61+
[ "$(wc -l < vc/v_win.c)" -gt 5000 ]
6462
6563
git -C vc add v.c v_win.c
6664
git -C vc commit -m "[v:master] $COMMIT_HASH - $COMMIT_MSG"

.github/workflows/gg_regressions_ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ jobs:
5454
id: compare
5555
continue-on-error: true
5656
run: |
57-
Xvfb $DISPLAY -screen 0 1280x1024x24 -fbdir /var/tmp/ &
57+
Xvfb "$DISPLAY" -screen 0 1280x1024x24 -fbdir /var/tmp/ &
5858
sleep 2; while [ ! -f /var/tmp/Xvfb_screen0 ]; do sleep 0.5; done # give xvfb time to start, even on slow CI runs
5959
sleep 5; ./v gret -t ./gg-regression-images/vgret.v_examples.toml -v ./gg-sample_images ./gg-regression-images
6060

.github/workflows/hub_docker_ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ jobs:
3333
- name: generate tags conditionally
3434
id: gen_tags
3535
run: |
36-
if [[ ${{ matrix.os }} == 'debian' ]]; then
37-
echo 'TAGS=thevlang/vlang:latest,thevlang/vlang:${{ matrix.os }}' >> $GITHUB_OUTPUT
36+
if [[ "${{ matrix.os }}" == 'debian' ]]; then
37+
echo 'TAGS=thevlang/vlang:latest,thevlang/vlang:${{ matrix.os }}' >> "$GITHUB_OUTPUT"
3838
else
39-
echo 'TAGS=thevlang/vlang:${{ matrix.os }}' >> $GITHUB_OUTPUT
39+
echo 'TAGS=thevlang/vlang:${{ matrix.os }}' >> "$GITHUB_OUTPUT"
4040
fi
4141
4242
- uses: docker/build-push-action@v6

.github/workflows/other_ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ jobs:
3939
run: |
4040
gpl_search_cmd="grep 'GPL' -r --exclude-dir=.git --exclude=*.yml --exclude=*.md --exclude=*.vv --exclude=*_test.v ."
4141
cd vmaster
42-
eval $gpl_search_cmd > ../gpl_res_vmaster
42+
eval "$gpl_search_cmd" > ../gpl_res_vmaster
4343
cd ../v
44-
eval $gpl_search_cmd > ../gpl_res_vnew
44+
eval "$gpl_search_cmd" > ../gpl_res_vnew
4545
cd ..
4646
diff -d -a -U 2 --color=always gpl_res_vmaster gpl_res_vnew
4747
@@ -53,7 +53,7 @@ jobs:
5353
steps:
5454
- uses: actions/checkout@v4
5555
- name: Environment info
56-
run: echo $VFLAGS $GITHUB_SHA $GITHUB_REF
56+
run: echo "$VFLAGS $GITHUB_SHA $GITHUB_REF"
5757
- name: Build local v
5858
run: make -j4 && ./v symlink
5959
- name: v test-cleancode
@@ -69,7 +69,7 @@ jobs:
6969
steps:
7070
- uses: actions/checkout@v4
7171
- name: Environment info
72-
run: echo $VFLAGS $GITHUB_SHA $GITHUB_REF
72+
run: echo "$VFLAGS $GITHUB_SHA $GITHUB_REF"
7373
- name: Build local v
7474
run: make -j4 && ./v symlink
7575
- name: Clone & Build previous vmaster/v

.github/workflows/paths_ci.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,21 @@ jobs:
2525
path: '你好 my $path, @с интервали'
2626
- name: Build V
2727
run: |
28+
# shellcheck disable=SC2016
2829
echo '你好 my $path, @с интервали'
2930
ls -la
31+
# shellcheck disable=SC2016
3032
cd '你好 my $path, @с интервали'
3133
ls -la
3234
make
3335
- name: v doctor
3436
run: |
37+
# shellcheck disable=SC2016
3538
cd '你好 my $path, @с интервали'
3639
./v doctor
3740
- name: v tests
3841
run: |
42+
# shellcheck disable=SC2016
3943
cd '你好 my $path, @с интервали'
4044
./v test vlib/builtin vlib/os
4145
@@ -49,8 +53,10 @@ jobs:
4953
persist-credentials: false
5054
- name: Build V
5155
run: |
56+
# shellcheck disable=SC2016
5257
echo '你好 my $path, @с интервали'
5358
ls -la
59+
# shellcheck disable=SC2016
5460
cd '你好 my $path, @с интервали'
5561
ls -la
5662
make
@@ -59,10 +65,12 @@ jobs:
5965
./v -b js run examples/hello_world.v
6066
- name: v doctor
6167
run: |
68+
# shellcheck disable=SC2016
6269
cd '你好 my $path, @с интервали'
6370
./v doctor
6471
- name: v tests
6572
run: |
73+
# shellcheck disable=SC2016
6674
cd '你好 my $path, @с интервали'
6775
./v test vlib/builtin vlib/os
6876

0 commit comments

Comments
 (0)