mirror of
https://github.com/vlang/v.git
synced 2025-09-17 11:26:17 -04:00
ci: add a second stage verification, that the generated v.c is viable in bootstrapping_works_ci.yml (#19640)
This commit is contained in:
parent
a7b9518ce5
commit
6ef4c347a8
94
.github/workflows/bootstrapping_works_ci.yml
vendored
94
.github/workflows/bootstrapping_works_ci.yml
vendored
@ -3,62 +3,38 @@ name: Bootstrapping works
|
|||||||
on:
|
on:
|
||||||
schedule:
|
schedule:
|
||||||
- cron: '0 */6 * * *'
|
- cron: '0 */6 * * *'
|
||||||
|
push:
|
||||||
|
paths-ignore:
|
||||||
|
- "**.md"
|
||||||
|
pull_request:
|
||||||
|
paths-ignore:
|
||||||
|
- "**.md"
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: code-ci-${{ github.event.pull_request.number || github.sha }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
ubuntu:
|
bootstrapping-works:
|
||||||
runs-on: ubuntu-latest
|
if: >
|
||||||
if: github.event.ref == 'refs/heads/master' && github.event.repository.full_name == 'vlang/v'
|
github.event_name != 'push'
|
||||||
|
|| github.event.ref == 'refs/heads/master'
|
||||||
|
|| github.event.repository.full_name != 'vlang/v'
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
os: [ubuntu-latest, macos-latest]
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
timeout-minutes: 30
|
timeout-minutes: 30
|
||||||
env:
|
env:
|
||||||
VFLAGS: -cc tcc -no-retry-compilation
|
VFLAGS: -cc clang -no-parallel
|
||||||
B_CFLAGS: -g -std=c99 -w
|
B_CFLAGS: -g
|
||||||
B_LFLAGS: -lm -lpthread
|
B_LFLAGS: -lm -lpthread
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 10
|
fetch-depth: 10
|
||||||
- name: Build v
|
- name: Build v
|
||||||
run: make
|
run: make
|
||||||
|
|
||||||
- name: v.c can be compiled and run with -os cross (bootstrapping works)
|
|
||||||
run: |
|
|
||||||
ls -la v vc/v.c
|
|
||||||
./v -os cross -o vc/v.c cmd/v
|
|
||||||
gcc $B_CFLAGS -o v_from_vc vc/v.c $B_LFLAGS
|
|
||||||
ls -lart v_from_vc
|
|
||||||
./v_from_vc version
|
|
||||||
./v_from_vc run examples/hello_world.v
|
|
||||||
./v_from_vc -o v_from_vc_produced_native_v cmd/v
|
|
||||||
./v_from_vc_produced_native_v run examples/hello_world.v
|
|
||||||
make local=1
|
|
||||||
ls -la v vc/v.c v_from_vc v_from_vc_produced_native_v
|
|
||||||
|
|
||||||
- name: Ensure v up works
|
|
||||||
run: |
|
|
||||||
./v cmd/tools/oldv.v
|
|
||||||
./cmd/tools/oldv -v HEAD^^^^^
|
|
||||||
cd ~/.cache/oldv/v_at_HEAD_____/
|
|
||||||
./v version
|
|
||||||
./v -v up
|
|
||||||
./v version
|
|
||||||
./v -o v2 cmd/v
|
|
||||||
./v2 -o v3 cmd/v
|
|
||||||
|
|
||||||
macos:
|
|
||||||
runs-on: macos-latest
|
|
||||||
if: github.event.ref == 'refs/heads/master' && github.event.repository.full_name == 'vlang/v'
|
|
||||||
timeout-minutes: 30
|
|
||||||
env:
|
|
||||||
VFLAGS: -cc clang
|
|
||||||
B_CFLAGS: -g -std=c99 -w
|
|
||||||
B_LFLAGS: -lm -lpthread
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
with:
|
|
||||||
fetch-depth: 10
|
|
||||||
- name: Build V
|
|
||||||
run: make && ./v -cg -cstrict -o v cmd/v
|
|
||||||
|
|
||||||
- name: v.c can be compiled and run with -os cross (bootstrapping works)
|
- name: v.c can be compiled and run with -os cross (bootstrapping works)
|
||||||
run: |
|
run: |
|
||||||
ls -la v vc/v.c
|
ls -la v vc/v.c
|
||||||
@ -69,7 +45,29 @@ jobs:
|
|||||||
./v_from_vc run examples/hello_world.v
|
./v_from_vc run examples/hello_world.v
|
||||||
./v_from_vc -o v_from_vc_produced_native_v cmd/v
|
./v_from_vc -o v_from_vc_produced_native_v cmd/v
|
||||||
./v_from_vc_produced_native_v run examples/hello_world.v
|
./v_from_vc_produced_native_v run examples/hello_world.v
|
||||||
### the next make invocation will simulate building V from scratch,
|
### the next make invocation will simulate building V from scratch
|
||||||
### using this commit
|
|
||||||
make local=1
|
make local=1
|
||||||
ls -la v vc/v.c v_from_vc v_from_vc_produced_native_v
|
ls -la v vc/v.c v_from_vc v_from_vc_produced_native_v
|
||||||
|
./v_from_vc_produced_native_v -os cross -o vc/v.c cmd/v
|
||||||
|
### do it a second time, just in case:
|
||||||
|
clang $B_CFLAGS -o v_from_vc2 vc/v.c $B_LFLAGS
|
||||||
|
ls -lart v_from_vc2
|
||||||
|
./v_from_vc2 version
|
||||||
|
./v_from_vc2 run examples/hello_world.v
|
||||||
|
./v_from_vc2 -o v_from_vc_produced_native_v2 cmd/v
|
||||||
|
./v_from_vc_produced_native_v2 run examples/hello_world.v
|
||||||
|
make local=1
|
||||||
|
ls -la v vc/v.c
|
||||||
|
ls -la v_from_vc v_from_vc_produced_native_v
|
||||||
|
ls -la v_from_vc2 v_from_vc_produced_native_v2
|
||||||
|
|
||||||
|
- name: Ensure v up works
|
||||||
|
run: |
|
||||||
|
./v cmd/tools/oldv.v
|
||||||
|
./cmd/tools/oldv -v HEAD^^^
|
||||||
|
cd ~/.cache/oldv/v_at_HEAD___/
|
||||||
|
./v version
|
||||||
|
./v -v up
|
||||||
|
./v version
|
||||||
|
./v -o v2 cmd/v
|
||||||
|
./v2 -o v3 cmd/v
|
||||||
|
Loading…
x
Reference in New Issue
Block a user