About: Hi, I'm Swastik Baranwal, a software developer from New Delhi, India passionate about open-source contribution, Gopher, Pythoneer, Compiler Design and DevOps.
Location:
Delhi, India
Joined:
Oct 7, 2019
Package Validator for V
Publish Date: Aug 18 '20
6 0
This workflow is a package validator for V Language. It uses V Actions for building and using V for Windows 10, Ubuntu 18.04 LTS and MacOS. This is a pretty simple workflow as V is really a new language and most things are handled by V itself!
It took a lot of time to create as I was backed by the limitations of V so I had to tell the creator about these issues which he fixed it in his free time but of course he couldn't solve all.
More things will be added soon. Any suggestions are welcome!
My Workflow
I am using this as my Actions for V as its made by the community.
Github Action that allow you to compile v programs without the use of docker (because it's very slow)
This repository will be ARCHIVED soon !! Check the official action
Setup V environment
GitHub Action that allows you to compile V programs without the use of Docker (because it's very slow).
Usage
You just have to setup your workflow like this:
# file: .github/workflows/vlang-build-pipeline.ymlname: vlang-build-pipelineon:
push:
paths-ignore:
- '**.md'jobs:
run:
name: Runruns-on: ubuntu-lateststeps:
- name: Checkoutuses: actions/checkout@v2
- name: Set up V version latestuses: nocturlab/setup-vlang-action@v1with:
v-version: latestid: v
- name: Build repository apprun: v .
- name: Run V testsrun: v test .
Inputs
v-version: V version. Can be either exact version number, latest (by default), or master (use the master branch instead of release).
name:CIon:push:branches:[master]pull_request:types:[opened,synchronize]jobs:test:name:Run tests on ${{ matrix.os }} ${{ matrix.v-version }}strategy:matrix:os:[ubuntu-latest,macos-latest,windows-latest]v-version:[master,latest]runs-on:${{ matrix.os }}steps:-uses:actions/checkout@v1-uses:nocturlab/setup-vlang-action@masterwith:v-version:master-name:Run vetrun:v vet .-name:Run testsrun:v test .-name:vfmt verifyrun:v fmt -verify -diff *.v
How it works
This workflow uses the master branch of V repo. It goes through all the .v files in the current directory which includes vet i.e. find unnecessary code which can be optimized, test which tests all files with __test as suffix and fmt which formats the code but here we are using using -verify flag to see it's the files are formatted or not.
Currently v fmt -verify -diff shows the diff of the original and formatted files as -verify doesn't assert true even though they are formatted, its due to line endings. (LF v/s CRLF)