From 708b7cddf62b4f5bea64c49d55fe9b564bfd5516 Mon Sep 17 00:00:00 2001 From: Turiiya <34311583+ttytm@users.noreply.github.com> Date: Sat, 21 Oct 2023 03:36:48 +0200 Subject: [PATCH] Fix lints, rework and enable lint workflow (#177) --- .github/workflows/ci.yml | 85 ------------------------------ .github/workflows/lint.yml | 40 ++++++++++++++ .github/workflows/markdownlint.yml | 20 ------- README.md | 19 +++++-- static/DOCS.md | 19 +++++-- vcl/README.md | 19 +++++-- 6 files changed, 85 insertions(+), 117 deletions(-) create mode 100644 .github/workflows/lint.yml delete mode 100644 .github/workflows/markdownlint.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9cbbb7ba4..01dc51d17 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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/setup-v@v1.3 - 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/setup-v@v1.3 - 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 }} diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 000000000..5486bc77d --- /dev/null +++ b/.github/workflows/lint.yml @@ -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/setup-v@v1.3 + 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/setup-v@v1.3 + 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 . diff --git a/.github/workflows/markdownlint.yml b/.github/workflows/markdownlint.yml deleted file mode 100644 index af64a2030..000000000 --- a/.github/workflows/markdownlint.yml +++ /dev/null @@ -1,20 +0,0 @@ -name: Markdown Lint - -on: - push: - branches: - - main - - pull_request: - branches: - - main - -jobs: - markdownlint: - name: Markdown Lint - runs-on: ubuntu-latest - steps: - - name: Begin CI... - uses: actions/checkout@v3 - - name: Markdown Lint - uses: articulate/actions-markdownlint@v1 diff --git a/README.md b/README.md index abb1f3933..3d66618ee 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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/ + + + +[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 diff --git a/static/DOCS.md b/static/DOCS.md index 3eed06ead..19760bcd2 100644 --- a/static/DOCS.md +++ b/static/DOCS.md @@ -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 @@ -96,3 +96,14 @@ v test . Made with [contributors-img](https://contrib.rocks). + + + +[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 diff --git a/vcl/README.md b/vcl/README.md index 83caa292b..2ffbfe88c 100644 --- a/vcl/README.md +++ b/vcl/README.md @@ -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 @@ -73,3 +73,14 @@ do the following: ```sh export VCL_LIBOPENCL_PATH=/usr/local/cuda/lib64/libOpenCL.so ``` + + + +[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