2023-01-19 15:28:37 +03:00
|
|
|
name: Code CI macos
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
paths-ignore:
|
|
|
|
- "**.md"
|
|
|
|
- "**.yml"
|
|
|
|
pull_request:
|
|
|
|
paths-ignore:
|
|
|
|
- "**.md"
|
|
|
|
- "**.yml"
|
|
|
|
|
|
|
|
concurrency:
|
|
|
|
group: build-ci-macos-${{ github.event.pull_request.number || github.sha }}
|
|
|
|
cancel-in-progress: true
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
macos:
|
|
|
|
runs-on: macOS-12
|
|
|
|
if: github.event_name != 'push' || github.event.ref == 'refs/heads/master' || github.event.repository.full_name != 'vlang/v'
|
|
|
|
timeout-minutes: 121
|
|
|
|
env:
|
|
|
|
VFLAGS: -cc clang
|
|
|
|
PKG_CONFIG_PATH: /usr/local/opt/pkgconfig:/usr/local/opt/libpq/lib/pkgconfig:/usr/local/opt/openssl@3/lib/pkgconfig:/opt/homebrew/lib/pkgconfig:/opt/homebrew/opt/libpq/lib/pkgconfig:/opt/homebrew/opt/openssl@3/lib/pkgconfig
|
|
|
|
steps:
|
2023-02-21 14:40:24 +03:00
|
|
|
- uses: actions/checkout@v3
|
2023-02-25 15:25:08 +03:00
|
|
|
- uses: actions/setup-node@v3
|
2023-01-19 15:28:37 +03:00
|
|
|
with:
|
2023-02-25 15:29:00 +03:00
|
|
|
node-version: 16
|
2023-01-19 15:28:37 +03:00
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
|
|
|
echo "PKG_CONFIG_PATH is '$PKG_CONFIG_PATH'"
|
|
|
|
brew install libpq openssl
|
|
|
|
export LIBRARY_PATH="$LIBRARY_PATH:/usr/local/opt/openssl/lib/"
|
|
|
|
echo "LIBRARY_PATH is '$LIBRARY_PATH'"
|
|
|
|
- name: Build V
|
|
|
|
run: make -j4 && ./v -cg -cstrict -o v cmd/v
|
|
|
|
- name: Run sanitizers
|
|
|
|
run: |
|
|
|
|
./v -o v2 cmd/v -cflags -fsanitize=undefined
|
|
|
|
UBSAN_OPTIONS=print_stacktrace=1:halt_on_error=1 ./v2 -o v.c cmd/v
|
|
|
|
- name: Build V using V
|
|
|
|
run: ./v -o v2 cmd/v && ./v2 -o v3 cmd/v
|
|
|
|
- name: Test symlink
|
|
|
|
run: ./v symlink
|
|
|
|
- name: Build vpm
|
2023-03-15 17:54:16 +03:00
|
|
|
run: git clone --depth 1 https://github.com/vlang/vpm && cd vpm && ../v . || ../v cmd/vpm && cd ..
|
2023-01-19 15:28:37 +03:00
|
|
|
# - name: Set up pg database
|
|
|
|
# run: |
|
|
|
|
# pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start
|
|
|
|
# psql -d postgres -c 'select rolname from pg_roles'
|
|
|
|
# psql -d postgres -c 'create database customerdb;'
|
|
|
|
# psql -d customerdb -f examples/database/pg/mydb.sql
|
|
|
|
# - name: Test v->c
|
|
|
|
# run: ./v test-all
|
|
|
|
# - name: Test v binaries
|
|
|
|
# run: ./v build-vbinaries
|
|
|
|
## - name: Test v->js
|
|
|
|
## run: ./v -o hi.js examples/hello_v_js.v && node hi.js
|
|
|
|
- name: Verify `v test` works
|
|
|
|
run: |
|
|
|
|
echo $VFLAGS
|
|
|
|
./v cmd/tools/test_if_v_test_system_works.v
|
|
|
|
./cmd/tools/test_if_v_test_system_works
|
|
|
|
- name: All code is formatted
|
|
|
|
run: VJOBS=1 ./v test-cleancode
|
|
|
|
- name: Self tests
|
|
|
|
run: VJOBS=1 ./v test-self
|
|
|
|
- name: Build examples
|
|
|
|
run: ./v build-examples
|
|
|
|
- name: Build examples with -autofree
|
|
|
|
run: |
|
|
|
|
./v -autofree -o tetris examples/tetris/tetris.v
|
|
|
|
./v -autofree -o blog tutorials/building_a_simple_web_blog_with_vweb/code/blog
|
|
|
|
- name: v doctor
|
|
|
|
run: |
|
|
|
|
./v doctor
|
|
|
|
- name: Test ved
|
|
|
|
run: |
|
|
|
|
git clone --depth 1 https://github.com/vlang/ved
|
|
|
|
cd ved && ../v -o ved .
|
|
|
|
../v -autofree .
|
|
|
|
../v -prod .
|
|
|
|
cd ..
|
|
|
|
# - name: Test c2v
|
|
|
|
# run: |
|
|
|
|
# git clone --depth 1 https://github.com/vlang/c2v
|
|
|
|
# cd c2v && ../v -o c2v .
|
|
|
|
# ../v .
|
|
|
|
# ../v run tests/run_tests.vsh
|
|
|
|
# ../v -experimental -w c2v_test.v
|
|
|
|
# cd ..
|
|
|
|
- name: Build V UI examples
|
|
|
|
run: |
|
|
|
|
git clone --depth 1 https://github.com/vlang/ui
|
|
|
|
cd ui
|
|
|
|
mkdir -p ~/.vmodules
|
|
|
|
ln -s $(pwd) ~/.vmodules/ui
|
|
|
|
../v examples/rectangles.v
|
|
|
|
## ../v run examples/build_examples.vsh
|
|
|
|
- name: V self compilation with -usecache
|
|
|
|
run: |
|
|
|
|
unset VFLAGS
|
|
|
|
./v -usecache examples/hello_world.v && examples/hello_world
|
|
|
|
./v -o v2 -usecache cmd/v
|
|
|
|
./v2 -o v3 -usecache cmd/v
|
|
|
|
./v3 version
|
|
|
|
./v3 -o tetris -usecache examples/tetris/tetris.v
|
|
|
|
- name: V self compilation with -parallel-cc
|
|
|
|
run: |
|
|
|
|
./v -o v2 -parallel-cc cmd/v
|
|
|
|
- name: Test password input
|
|
|
|
run: |
|
|
|
|
./v examples/password
|
|
|
|
./v examples/password/password_ci.vsh
|
2023-03-30 08:58:52 +03:00
|
|
|
- name: Test readline
|
|
|
|
run: |
|
|
|
|
./v examples/readline/readline_ci.v
|
|
|
|
./v examples/readline/readline.vsh
|