diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6f76f6c7e6..4adf2c4f60 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,16 +2,12 @@ name: CI on: [push, pull_request] jobs: build-osx: - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [macOS-10.14] - node-version: [12.x] + runs-on: macOS-10.14 steps: - uses: actions/checkout@v1 - uses: actions/setup-node@v1 with: - node-version: ${{ matrix.node-version }} + node-version: 12.x - name: Build and test run: | brew install freetype glfw openssl @@ -19,54 +15,60 @@ jobs: make ./v -o v compiler ./v test v - echo "fn main(){ println('Hello from V.js') }" > hi.v - ./v -o hi.js hi.v + ./v -o hi.js examples/hello_v_js.v node hi.js git clone --depth 1 https://github.com/vlang/vid.git cd vid && ../v -debug -o vid . build-ubuntu: - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ubuntu-18.04] - node-version: [12.x] + runs-on: ubuntu-18.04 steps: - uses: actions/checkout@v1 - uses: actions/setup-node@v1 with: - node-version: ${{ matrix.node-version }} + node-version: 12.x - name: Build and test run: | sudo apt-get update && sudo apt-get install -y libglfw3 libglfw3-dev libfreetype6-dev libssl-dev make ./v -o v compiler ./v test v - echo "fn main(){ println('Hello from V.js') }" > hi.v - ./v -o hi.js hi.v + ./v -o hi.js examples/hello_v_js.v node hi.js build-windows-gcc: - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [windows-2019] + runs-on: windows-2019 steps: - uses: actions/checkout@v1 - - name: Build and test + #- uses: actions/setup-node@v1 + # with: + # node-version: 12.x + - name: Build run: | git clone --depth=1 https://github.com/ubawurinna/freetype-windows-binaries.git thirdparty/freetype/ - make -gcc - ./v.exe test v + .\make.bat -gcc + - name: Test + run: | + .\v.exe test v + ## v.js dosent work on windows + #.\v.exe -o hi.js examples/hello_v_js.v + #node hi.js build-windows-msvc: - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [windows-2019] + runs-on: windows-2019 steps: - uses: actions/checkout@v1 - - name: Build and test + #- uses: actions/setup-node@v1 + # with: + # node-version: 12.x + - name: Build env: VFLAGS: -os msvc run: | git clone --depth=1 https://github.com/ubawurinna/freetype-windows-binaries.git thirdparty/freetype/ - make -msvc - ./v.exe test v + .\make.bat -msvc + - name: Test + env: + VFLAGS: -os msvc + run: | + .\v.exe test v + ## v.js dosent work on windows + #.\v.exe -o hi.js examples/hello_v_js.v + #node hi.js diff --git a/README.md b/README.md index c4422f7501..69ac7da26b 100644 --- a/README.md +++ b/README.md @@ -143,6 +143,8 @@ glfw dependency will be removed soon. ## JavaScript backend +[examples/hello_v_js.v](examples/hello_v_js.v): + ``` fn main() { for i := 0; i < 3; i++ { @@ -152,7 +154,7 @@ fn main() { ``` ```bash -v -o hi.js hi.v && node hi.js +v -o hi.js examples/hello_v_js.v && node hi.js Hello from V.js Hello from V.js Hello from V.js diff --git a/examples/hello_v_js.v b/examples/hello_v_js.v new file mode 100644 index 0000000000..16c9536ed2 --- /dev/null +++ b/examples/hello_v_js.v @@ -0,0 +1,5 @@ +fn main() { + for i := 0; i < 3; i++ { + println('Hello from V.js') + } +}