Skip to content

ci: update caching paths for lint workflow #41

ci: update caching paths for lint workflow

ci: update caching paths for lint workflow #41

Workflow file for this run

name: CI
on:
push:
paths-ignore: ['**/*.md']
pull_request:
paths-ignore: ['**/*.md']
env:
MOD_PATH: ~/.vmodules/vibe
jobs:
setup:
runs-on: ubuntu-latest
steps:
- name: Cache Status
id: cache-status
uses: actions/cache@v3
with:
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 }}
lint:
needs: setup
uses: tobealive/vibe/.github/workflows/lint.yml@main
simple-build:
needs: setup
runs-on: ubuntu-latest
strategy:
matrix:
optimization: ['', -cstrict]
steps:
- name: Restore V Cache
uses: actions/cache/restore@v3
with:
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
with:
path: ${{ github.event.repository.name }}
- name: Copy ${{ github.event.repository.name }} to .vmodules
run: cp -r ${{ github.event.repository.name }} ${{ env.MOD_PATH }}
- name: ${{ matrix.optimization }} build
run: v -cg -shared ${{ matrix.optimization }} ${{ env.MOD_PATH }}
test:
needs: simple-build
runs-on: ubuntu-latest
steps:
- name: Restore V Cache
uses: actions/cache/restore@v3
with:
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
with:
path: ${{ github.event.repository.name }}
- name: Copy ${{ github.event.repository.name }} to .vmodules
run: cp -r ${{ github.event.repository.name }} ${{ env.MOD_PATH }}
- name: Run tests
run: v test ${{ env.MOD_PATH }}
different-compilers:
needs: test
runs-on: ubuntu-latest
strategy:
matrix:
compiler: [gcc, clang]
optimization: ['', -prod]
steps:
- name: Restore V Cache
uses: actions/cache/restore@v3
with:
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
with:
path: ${{ github.event.repository.name }}
- name: Copy ${{ github.event.repository.name }} to .vmodules
run: cp -r ${{ github.event.repository.name }} ${{ env.MOD_PATH }}
- name: ${{ matrix.compiler }} ${{ matrix.optimization }} build
run: v -cg -shared -cc ${{ matrix.compiler }} ${{ matrix.optimization }} ${{ env.MOD_PATH }}
gcc-sanitizers:
needs: different-compilers
runs-on: ubuntu-latest
strategy:
matrix:
sanitizer: [leak] # TODO: thread sanitizer was removed due to strange warnings. It should be fixed and turned on.
steps:
- name: Restore V Cache
uses: actions/cache/restore@v3
with:
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
with:
path: ${{ github.event.repository.name }}
- name: Copy ${{ github.event.repository.name }} to .vmodules
run: cp -r ${{ github.event.repository.name }} ${{ env.MOD_PATH }}
- name: GCC ${{ matrix.sanitizer }} sanitizer
run: v -cc gcc -cflags -fsanitize=${{ matrix.sanitizer }} test ${{ env.MOD_PATH }}