Compare commits

...

2 Commits

Author SHA1 Message Date
ge
98738e773d doc: pass v vet in CI 2026-01-03 16:44:31 +03:00
ge
791b376ff3 ci: Add CI 2026-01-03 16:41:00 +03:00
3 changed files with 76 additions and 1 deletions

48
.github/workflows/docs.yaml vendored Normal file
View File

@@ -0,0 +1,48 @@
name: Docs
on:
push:
branches: [ "master" ]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup V
run: |
wget -qO /tmp/v.zip https://github.com/vlang/v/releases/latest/download/v_linux.zip
unzip -q /tmp/v.zip -d /tmp
echo /tmp/v >> "$GITHUB_PATH"
- name: Build docs
run: |
v doc -f html -m .
pushd _docs
ln -vs ${{ github.event.repository.name }}.html index.html
ls -alFh
popd
- name: Upload static files as artifact
id: deployment
uses: actions/upload-pages-artifact@v3
with:
path: _docs/
deploy:
needs: build
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
permissions:
contents: read
pages: write
id-token: write

27
.github/workflows/test.yaml vendored Normal file
View File

@@ -0,0 +1,27 @@
name: Lint and test
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
workflow_dispatch:
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup V
run: |
wget -qO /tmp/v.zip https://github.com/vlang/v/releases/latest/download/v_linux.zip
unzip -q /tmp/v.zip -d /tmp
echo /tmp/v >> "$GITHUB_PATH"
- name: Run tests
run: |
v fmt -verify .
v vet -v -W -I -F -r .
v missdoc -r --verify .
v -stats test .

View File

@@ -121,7 +121,7 @@ pub fn (r Record) field(name string, value Value) Record {
return r.append(Field{ name: name, value: value }) return r.append(Field{ name: name, value: value })
} }
// field adds new message field to a record and returns the modified record. // message adds new message field to a record and returns the modified record.
// This is a shothand for `field('message', 'message text')`. // This is a shothand for `field('message', 'message text')`.
pub fn (r Record) message(s string) Record { pub fn (r Record) message(s string) Record {
return r.field('message', s) return r.field('message', s)