ci: stop earlier on vc/v.c files, that may break on systems != linux (#21397)

This commit is contained in:
Delyan Angelov 2024-05-01 22:51:20 +03:00 committed by GitHub
parent 6f7f7e08c6
commit c3d75cf4f9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -42,17 +42,21 @@ jobs:
COMMIT_MSG=$(git log -1 --oneline --pretty='%s' HEAD) COMMIT_MSG=$(git log -1 --oneline --pretty='%s' HEAD)
rm -rf vc rm -rf vc
.github/workflows/retry.sh git clone --depth=1 \ ./v retry -- git clone --depth=1 \
https://vlang-bot:${{ secrets.VLANG_BOT_SECRET }}@github.com/vlang/vc.git https://vlang-bot:${{ secrets.VLANG_BOT_SECRET }}@github.com/vlang/vc.git
rm -rf vc/v.c vc/v_win.c rm -rf vc/v.c vc/v_win.c
./v -o vc/v.c -os cross cmd/v ./v -o vc/v.c -cross cmd/v
./v -o vc/v_win.c -os windows -cc msvc cmd/v ./v -o vc/v_win.c -os windows -cc msvc cmd/v
sed -i "1s/^/#define V_COMMIT_HASH \"$COMMIT_HASH\"\n/" vc/v.c sed -i "1s/^/#define V_COMMIT_HASH \"$COMMIT_HASH\"\n/" vc/v.c
sed -i "1s/^/#define V_COMMIT_HASH \"$COMMIT_HASH\"\n/" vc/v_win.c sed -i "1s/^/#define V_COMMIT_HASH \"$COMMIT_HASH\"\n/" vc/v_win.c
# do some sanity checks for the generated v.c file:
grep 'Turned ON custom defines: no_backtrace,cross' vc/v.c
grep '#define CUSTOM_DEFINE_cross' vc/v.c
# ensure the C files are over 5000 lines long, as a safety measure # ensure the C files are over 5000 lines long, as a safety measure
[ $(wc -l < vc/v.c) -gt 5000 ] [ $(wc -l < vc/v.c) -gt 5000 ]
[ $(wc -l < vc/v_win.c) -gt 5000 ] [ $(wc -l < vc/v_win.c) -gt 5000 ]
@ -61,7 +65,7 @@ jobs:
git -C vc commit -m "[v:master] $COMMIT_HASH - $COMMIT_MSG" git -C vc commit -m "[v:master] $COMMIT_HASH - $COMMIT_MSG"
# in case there are recent commits: # in case there are recent commits:
.github/workflows/retry.sh git -C vc pull --rebase origin master ./v retry -- git -C vc pull --rebase origin master
git -C vc log -3 git -C vc log -3
- name: Deploy - name: Deploy