Skip to content

Commit

Permalink
ci: check cache status before v install, add setup step to lint wf
Browse files Browse the repository at this point in the history
  • Loading branch information
ttytm committed Jul 1, 2023
1 parent abdaa65 commit 1f3bd6e
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 1 deletion.
10 changes: 9 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,15 @@ jobs:
setup:
runs-on: ubuntu-latest
steps:
- name: Install V
- 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
Expand Down
27 changes: 27 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,33 @@ env:
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:
Expand Down

0 comments on commit 1f3bd6e

Please sign in to comment.