Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix lints, rework and enable lint workflow #177

Merged
merged 1 commit into from
Oct 21, 2023
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 0 additions & 85 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,91 +17,6 @@ on:
- main

jobs:
validate-docs:
runs-on: ubuntu-latest
steps:
- name: Checkout VSL
uses: actions/checkout@v3
with:
path: vsl

- name: Setup V
uses: vlang/[email protected]
with:
check-latest: true

- name: V doctor
run: v doctor

- name: Install dependencies
run: |
sudo apt-get update && \
sudo apt-get install --quiet -y --no-install-recommends \
gfortran \
libxi-dev \
libxcursor-dev \
mesa-common-dev \
liblapacke-dev \
libopenblas-dev \
libgc-dev \
libgl1-mesa-dev \
libopenmpi-dev \
libhdf5-dev \
hdf5-tools \
opencl-headers

- name: Copy VSL source code to V Modules
run: cp -rf ./vsl ~/.vmodules

- name: Validate Docs
run: |
cd ~
v check-md ~/.vmodules/vsl

fmt-check:
runs-on: ubuntu-latest

steps:
- name: Checkout VSL
uses: actions/checkout@v3
with:
path: vsl

- name: Setup V
uses: vlang/[email protected]
with:
check-latest: true

- name: V doctor
run: v doctor

- name: Install dependencies
run: |
sudo apt-get update && \
sudo apt-get install --quiet -y --no-install-recommends \
gfortran \
libxi-dev \
libxcursor-dev \
mesa-common-dev \
liblapacke-dev \
libopenblas-dev \
libgc-dev \
libgl1-mesa-dev \
libopenmpi-dev \
libhdf5-dev \
hdf5-tools \
opencl-headers

- name: Move VSL source code to V Modules
run: mv ./vsl ~/.vmodules

- name: Verify Fmt
# TODO: Remove continue-on-error when v fmt -verify is fixed for VSL on CI
continue-on-error: true
run: |
cd ~
v fmt -verify ~/.vmodules/vsl

run-tests-on-linux:
runs-on: ${{ matrix.os }}

Expand Down
40 changes: 40 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Lint

on:
push:
pull_request:

jobs:
docs:
runs-on: ubuntu-latest
steps:
- name: Checkout VSL
uses: actions/checkout@v4
with:
path: vsl
- name: Setup V
uses: vlang/[email protected]
with:
check-latest: true
- name: Setup VSL as V module
run: mv vsl ~/.vmodules/
- name: Validate Docs
run: v check-md -hide-warnings ~/.vmodules/vsl

fmt:
runs-on: ubuntu-latest
steps:
- name: Checkout VSL
uses: actions/checkout@v4
with:
path: vsl
- name: Setup V
uses: vlang/[email protected]
with:
check-latest: true
- name: Setup VSL as V module
run: mv vsl ~/.vmodules/
- name: Check Formatting
# NOTE: `cd` into module dir required. Currently, running `v fmt -verify` from outside the module dir
# would encounter errors and `v fmt -w` would even break the module.
run: cd ~/.vmodules/vsl && v fmt -verify .
ulises-jeremias marked this conversation as resolved.
Show resolved Hide resolved
20 changes: 0 additions & 20 deletions .github/workflows/markdownlint.yml

This file was deleted.

19 changes: 15 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@

VSL is a V library to develop Artificial Intelligence and High-Performance Scientific Computations.

| | | | |
| :---------------------------------------------------------------------------------------------------------------------------------: | :---------------------------------------------------------------------------------------------------------------------: | :-------------------------------------------------------------------------------------: | :---------------------------------------------------------------------------------------------------: |
| ![sierpinski_triangle](https://raw.githubusercontent.com/vlang/vsl/main/vcl/static/sierpinski_triangle.png) | ![mandelbrot_blue_red_black](https://raw.githubusercontent.com/vlang/vsl/main/vcl/static/mandelbrot_blue_red_black.png) | ![julia](https://raw.githubusercontent.com/vlang/vsl/main/vcl/static/julia.png) | ![mandelbrot_basic](https://raw.githubusercontent.com/vlang/vsl/main/vcl/static/mandelbrot_basic.png) |
| ![mandelbrot_pseudo_random_colors](https://raw.githubusercontent.com/vlang/vsl/main/vcl/static/mandelbrot_pseudo_random_colors.png) | ![sierpinski_triangle2](https://raw.githubusercontent.com/vlang/vsl/main/vcl/static/sierpinski_triangle2.png) | ![julia_set](https://raw.githubusercontent.com/vlang/vsl/main/vcl/static/julia_set.png) | ![julia_basic](https://raw.githubusercontent.com/vlang/vsl/main/vcl/static/julia_basic.png) |
| | | | |
| :----------------------------------: | :----------------------------: | :------------: | :-------------------: |
| ![][sierpinski_triangle] | ![][mandelbrot_blue_red_black] | ![][julia] | ![][mandelbrot_basic] |
| ![][mandelbrot_pseudo_random_colors] | ![][sierpinski_triangle2] | ![][julia_set] | ![][julia_basic] |

## 📖 Docs

Expand Down Expand Up @@ -113,3 +113,14 @@ Made with [contributors-img](https://contrib.rocks).
[deploydocsurl]: https://github.com/vlang/vsl/actions/workflows/deploy-docs.yml
[licenseurl]: https://github.com/vlang/vsl/blob/main/LICENSE
[ModulesUrl]: https://vlang.github.io/vsl/

<!-- Images -->

[sierpinski_triangle]: https://raw.githubusercontent.com/vlang/vsl/main/vcl/static/sierpinski_triangle.png
[mandelbrot_blue_red_black]: https://raw.githubusercontent.com/vlang/vsl/main/vcl/static/mandelbrot_blue_red_black.png
[julia]: https://raw.githubusercontent.com/vlang/vsl/main/vcl/static/julia.png
[mandelbrot_basic]: https://raw.githubusercontent.com/vlang/vsl/main/vcl/static/mandelbrot_basic.png
[mandelbrot_pseudo_random_colors]: https://raw.githubusercontent.com/vlang/vsl/main/vcl/static/mandelbrot_pseudo_random_colors.png
[sierpinski_triangle2]: https://raw.githubusercontent.com/vlang/vsl/main/vcl/static/sierpinski_triangle2.png
[julia_set]: https://raw.githubusercontent.com/vlang/vsl/main/vcl/static/julia_set.png
[julia_basic]: https://raw.githubusercontent.com/vlang/vsl/main/vcl/static/julia_basic.png
19 changes: 15 additions & 4 deletions static/DOCS.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@

VSL is a V library to develop Artificial Intelligence and High-Performance Scientific Computations.

| | | | |
| :---------------------------------------------------------------------------------------------------------------------------------: | :---------------------------------------------------------------------------------------------------------------------: | :-------------------------------------------------------------------------------------: | :---------------------------------------------------------------------------------------------------: |
| ![sierpinski_triangle](https://raw.githubusercontent.com/vlang/vsl/main/vcl/static/sierpinski_triangle.png) | ![mandelbrot_blue_red_black](https://raw.githubusercontent.com/vlang/vsl/main/vcl/static/mandelbrot_blue_red_black.png) | ![julia](https://raw.githubusercontent.com/vlang/vsl/main/vcl/static/julia.png) | ![mandelbrot_basic](https://raw.githubusercontent.com/vlang/vsl/main/vcl/static/mandelbrot_basic.png) |
| ![mandelbrot_pseudo_random_colors](https://raw.githubusercontent.com/vlang/vsl/main/vcl/static/mandelbrot_pseudo_random_colors.png) | ![sierpinski_triangle2](https://raw.githubusercontent.com/vlang/vsl/main/vcl/static/sierpinski_triangle2.png) | ![julia_set](https://raw.githubusercontent.com/vlang/vsl/main/vcl/static/julia_set.png) | ![julia_basic](https://raw.githubusercontent.com/vlang/vsl/main/vcl/static/julia_basic.png) |
| | | | |
| :----------------------------------: | :----------------------------: | :------------: | :-------------------: |
| ![][sierpinski_triangle] | ![][mandelbrot_blue_red_black] | ![][julia] | ![][mandelbrot_basic] |
| ![][mandelbrot_pseudo_random_colors] | ![][sierpinski_triangle2] | ![][julia_set] | ![][julia_basic] |

## 📖 Docs

Expand Down Expand Up @@ -96,3 +96,14 @@ v test .
</a>

Made with [contributors-img](https://contrib.rocks).

<!-- Images -->

[sierpinski_triangle]: https://raw.githubusercontent.com/vlang/vsl/main/vcl/static/sierpinski_triangle.png
[mandelbrot_blue_red_black]: https://raw.githubusercontent.com/vlang/vsl/main/vcl/static/mandelbrot_blue_red_black.png
[julia]: https://raw.githubusercontent.com/vlang/vsl/main/vcl/static/julia.png
[mandelbrot_basic]: https://raw.githubusercontent.com/vlang/vsl/main/vcl/static/mandelbrot_basic.png
[mandelbrot_pseudo_random_colors]: https://raw.githubusercontent.com/vlang/vsl/main/vcl/static/mandelbrot_pseudo_random_colors.png
[sierpinski_triangle2]: https://raw.githubusercontent.com/vlang/vsl/main/vcl/static/sierpinski_triangle2.png
[julia_set]: https://raw.githubusercontent.com/vlang/vsl/main/vcl/static/julia_set.png
[julia_basic]: https://raw.githubusercontent.com/vlang/vsl/main/vcl/static/julia_basic.png
19 changes: 15 additions & 4 deletions vcl/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ VCL is a high level way of writting programs with OpenCL using V.
These are highly opinionated OpenCL bindings for V. It tries to make GPU computing easy,
with some sugar abstraction, V's concurency and channels.

| | | | |
| :---------------------------------------------------------------------------------------------------------------------------------: | :---------------------------------------------------------------------------------------------------------------------: | :-------------------------------------------------------------------------------------: | :---------------------------------------------------------------------------------------------------: |
| ![sierpinski_triangle](https://raw.githubusercontent.com/vlang/vsl/main/vcl/static/sierpinski_triangle.png) | ![mandelbrot_blue_red_black](https://raw.githubusercontent.com/vlang/vsl/main/vcl/static/mandelbrot_blue_red_black.png) | ![julia](https://raw.githubusercontent.com/vlang/vsl/main/vcl/static/julia.png) | ![mandelbrot_basic](https://raw.githubusercontent.com/vlang/vsl/main/vcl/static/mandelbrot_basic.png) |
| ![mandelbrot_pseudo_random_colors](https://raw.githubusercontent.com/vlang/vsl/main/vcl/static/mandelbrot_pseudo_random_colors.png) | ![sierpinski_triangle2](https://raw.githubusercontent.com/vlang/vsl/main/vcl/static/sierpinski_triangle2.png) | ![julia_set](https://raw.githubusercontent.com/vlang/vsl/main/vcl/static/julia_set.png) | ![julia_basic](https://raw.githubusercontent.com/vlang/vsl/main/vcl/static/julia_basic.png) |
| | | | |
| :----------------------------------: | :----------------------------: | :------------: | :-------------------: |
| ![][sierpinski_triangle] | ![][mandelbrot_blue_red_black] | ![][julia] | ![][mandelbrot_basic] |
| ![][mandelbrot_pseudo_random_colors] | ![][sierpinski_triangle2] | ![][julia_set] | ![][julia_basic] |

## Using custom OpenCL headers

Expand Down Expand Up @@ -73,3 +73,14 @@ do the following:
```sh
export VCL_LIBOPENCL_PATH=/usr/local/cuda/lib64/libOpenCL.so
```

<!-- Images -->

[sierpinski_triangle]: https://raw.githubusercontent.com/vlang/vsl/main/vcl/static/sierpinski_triangle.png
[mandelbrot_blue_red_black]: https://raw.githubusercontent.com/vlang/vsl/main/vcl/static/mandelbrot_blue_red_black.png
[julia]: https://raw.githubusercontent.com/vlang/vsl/main/vcl/static/julia.png
[mandelbrot_basic]: https://raw.githubusercontent.com/vlang/vsl/main/vcl/static/mandelbrot_basic.png
[mandelbrot_pseudo_random_colors]: https://raw.githubusercontent.com/vlang/vsl/main/vcl/static/mandelbrot_pseudo_random_colors.png
[sierpinski_triangle2]: https://raw.githubusercontent.com/vlang/vsl/main/vcl/static/sierpinski_triangle2.png
[julia_set]: https://raw.githubusercontent.com/vlang/vsl/main/vcl/static/julia_set.png
[julia_basic]: https://raw.githubusercontent.com/vlang/vsl/main/vcl/static/julia_basic.png
Loading