Skip to content

Commit 791b376

Browse files
committed
ci: Add CI
1 parent 1fa21a9 commit 791b376

2 files changed

Lines changed: 75 additions & 0 deletions

File tree

.github/workflows/docs.yaml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Docs
2+
on:
3+
push:
4+
branches: [ "master" ]
5+
workflow_dispatch:
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout code
12+
uses: actions/checkout@v4
13+
14+
- name: Setup V
15+
run: |
16+
wget -qO /tmp/v.zip https://github.com/vlang/v/releases/latest/download/v_linux.zip
17+
unzip -q /tmp/v.zip -d /tmp
18+
echo /tmp/v >> "$GITHUB_PATH"
19+
20+
- name: Build docs
21+
run: |
22+
v doc -f html -m .
23+
pushd _docs
24+
ln -vs ${{ github.event.repository.name }}.html index.html
25+
ls -alFh
26+
popd
27+
28+
- name: Upload static files as artifact
29+
id: deployment
30+
uses: actions/upload-pages-artifact@v3
31+
with:
32+
path: _docs/
33+
34+
deploy:
35+
needs: build
36+
environment:
37+
name: github-pages
38+
url: ${{ steps.deployment.outputs.page_url }}
39+
runs-on: ubuntu-latest
40+
steps:
41+
- name: Deploy to GitHub Pages
42+
id: deployment
43+
uses: actions/deploy-pages@v4
44+
45+
permissions:
46+
contents: read
47+
pages: write
48+
id-token: write

.github/workflows/test.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Lint and test
2+
on:
3+
push:
4+
branches: [ "master" ]
5+
pull_request:
6+
branches: [ "master" ]
7+
workflow_dispatch:
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v4
15+
16+
- name: Setup V
17+
run: |
18+
wget -qO /tmp/v.zip https://github.com/vlang/v/releases/latest/download/v_linux.zip
19+
unzip -q /tmp/v.zip -d /tmp
20+
echo /tmp/v >> "$GITHUB_PATH"
21+
22+
- name: Run tests
23+
run: |
24+
v fmt -verify .
25+
v vet -v -W -I -F -r .
26+
v missdoc -r --verify .
27+
v -stats test .

0 commit comments

Comments
 (0)