Skip to content

ci: check cache status before v install, add setup step to lint wf #1

ci: check cache status before v install, add setup step to lint wf

ci: check cache status before v install, add setup step to lint wf #1

Workflow file for this run

name: Lint
on:
workflow_call:
env:
WORK_PATH: /home/runner/work/${{ github.event.repository.name }}/${{ github.event.repository.name }}/
MOD_PATH: ~/.vmodules/vibe/
jobs:
setup:
runs-on: ubuntu-latest
steps:
- name: Cache Status
id: cache-status
uses: actions/cache
with:
path: ${{ env.WORK_PATH }}vlang/
key: ${{ runner.os }}-v-
- if: ${{ steps.cache-status.outputs.cache-hit != 'true' }}
name: Install V
uses: vlang/setup-v@v1.3
with:
check-latest: true
- if: ${{ steps.cache-status.outputs.cache-hit != 'true' }}
name: Add V Version to Environment
run: echo "V_VER=$(v -v)" >> $GITHUB_ENV
- if: ${{ steps.cache-status.outputs.cache-hit != 'true' }}
name: Cache V
uses: actions/cache/save@v3
with:
path: vlang/
key: ${{ runner.os }}-v-${{ env.V_VER }}
fmt:
runs-on: ubuntu-latest
steps:
- name: Restore Cache
uses: actions/cache/restore@v3
with:
path: ${{ env.WORK_PATH }}vlang/
key: ${{ runner.os }}-v-
fail-on-cache-miss: true
- name: Setup V
uses: vlang/setup-v@v1.3
- name: Setup libcurl
run: sudo apt install libcurl4-openssl-dev
- name: Checkout ${{ github.event.repository.name }}
uses: actions/checkout@v3
- name: Copy ${{ github.event.repository.name }} to .vmodules
run: cp -r ${{ env.WORK_PATH }} ${{ env.MOD_PATH }}
- name: Check Formatting
run: v fmt -verify ${{ env.MOD_PATH }}
vet:
runs-on: ubuntu-latest
steps:
- name: Restore V Cache
uses: actions/cache/restore@v3
with:
path: ${{ env.WORK_PATH }}vlang/
key: ${{ runner.os }}-v-
fail-on-cache-miss: true
- name: Setup V
uses: vlang/setup-v@v1.3
- name: Setup libcurl
run: sudo apt install libcurl4-openssl-dev
- name: Checkout ${{ github.event.repository.name }}
uses: actions/checkout@v3
- name: Copy ${{ github.event.repository.name }} to .vmodules
run: cp -r ${{ env.WORK_PATH }} ${{ env.MOD_PATH }}
- name: Vet ${{ github.event.repository.name }}
run: v vet -W ${{ env.MOD_PATH }}/src/