Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 4 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# LF everywhere: Windows runners check out with autocrlf, which fails `v fmt -verify`
* text=auto eol=lf
# the official test cases are byte-exact fixtures, some contain CR and CRLF on purpose
tests/test_cases/** -text
96 changes: 87 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
schedule:
# V master moves every day: catch a compiler change that breaks the module
- cron: '0 5 * * 1'

permissions:
contents: read
Expand All @@ -16,18 +18,94 @@ concurrency:

jobs:
test:
name: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
timeout-minutes: 40
defaults:
run:
shell: bash
# the checkout is in deps/kdl, and deps is VMODULES: `import kdl` resolves to
# the code under test, never to a copy installed elsewhere
working-directory: deps/kdl
env:
VMODULES: ${{ github.workspace }}/deps
# fail instead of retrying silently with V's compatibility compiler
V_MACOS_V3_NO_FALLBACK: '1'
steps:
- uses: actions/checkout@v7
with:
path: deps/kdl

- name: Set up V master
id: setup_v
uses: vlang/setup-v@v1.7
with:
check-latest: true

- name: V version
run: |
v version
echo "V master resolved by setup-v: ${{ steps.setup_v.outputs.version }}"
echo "V: $(v version), setup-v version: ${{ steps.setup_v.outputs.version }}" >> "$GITHUB_STEP_SUMMARY"

- name: Formatting
run: v fmt -verify .

- name: Vet
run: v vet .

- name: Documentation of public symbols
run: v missdoc --verify .

- name: Tests
run: v -stats test .

- name: Examples
run: |
for dir in examples/*/; do
echo "::group::${dir}"
v run "${dir}main.v"
echo "::endgroup::"
done

- name: README code blocks compile
# the 100-column limit of check-md is not a rule of this repository
run: v check-md -silent -hide-warnings -skip-line-length-check README.md examples

old-compiler:
# V's previous compiler is still what `-old-compiler` and the compatibility
# fallback use, and it compiles generics and GC roots differently
name: ubuntu-latest, old compiler
runs-on: ubuntu-latest
timeout-minutes: 15
timeout-minutes: 40
defaults:
run:
shell: bash
working-directory: deps/kdl
env:
VMODULES: ${{ github.workspace }}/deps
V_C_ERROR_BUG_REPORT_DISABLED: '1'
steps:
- uses: actions/checkout@v7
with:
path: deps/kdl

- name: Setup V
- name: Set up V master
uses: vlang/setup-v@v1.7
with:
# The 0.5.2 release tag fails to build itself on ubuntu-latest
# (vlib os C.open declaration conflict), so pin a known-good
# master commit instead.
version: aaaf0c7
check-latest: true

- name: Tests
run: v -old-compiler -stats test .

- name: Run tests
run: v test .
- name: Examples
run: |
for dir in examples/*/; do
echo "::group::${dir}"
v -old-compiler run "${dir}main.v"
echo "::endgroup::"
done
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# compiled programs and build artefacts
*.exe
*.o
*.so
*.dylib
*.dll
*.dSYM/
examples/*/main
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2026 David Legrand and Jengro777

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Loading
Loading