Skip to content

update workflow #117

update workflow

update workflow #117

Workflow file for this run

name: CI
on:
push:
paths-ignore: ['**/*.md']
pull_request:
paths-ignore: ['**/*.md']
env:
REPO_NAME: ${{ github.event.repository.name }}
MOD_PATH: ~/.vmodules/vibe
jobs:
setup:
runs-on: ubuntu-20.04
steps:
- name: Install V
uses: vlang/setup-v@v1.3
with:
check-latest: true
- name: Setup Dependencies
if: runner.os == 'Linux'
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: libcurl4-openssl-dev
version: 1.0
- name: Checkout ${{ env.REPO_NAME }}
uses: actions/checkout@v4
with:
path: ${{ env.REPO_NAME }}
- name: Setup ${{ env.REPO_NAME }}
run: cp -r ${{ env.REPO_NAME }} ${{ env.MOD_PATH }}
- name: Cache
uses: actions/cache/save@v3
with:
path: |
vlang
~/.vmodules
key: ${{ runner.os }}-${{ github.sha }}
lint:
needs: setup
uses: tobealive/vibe/.github/workflows/lint.yml@main
test:
needs: setup
runs-on: ubuntu-20.04
steps:
- name: Restore Cache
uses: actions/cache/restore@v3
with:
path: |
vlang
~/.vmodules
key: ${{ runner.os }}-${{ github.sha }}
fail-on-cache-miss: true
- name: Setup V
uses: vlang/setup-v@v1.3
- name: Setup Dependencies
if: runner.os == 'Linux'
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: libcurl4-openssl-dev
version: 1.0
- name: Run tests
uses: nick-fields/retry@v2
with:
timeout_minutes: 3
max_attempts: 3
command: v -cg test ${{ env.MOD_PATH }}
different-compilers:
needs: test
runs-on: ubuntu-20.04
strategy:
matrix:
cc: [gcc, clang]
optimization: ['', -prod, -cstrict]
fail-fast: false
steps:
- name: Restore Cache
uses: actions/cache/restore@v3
with:
path: |
vlang
~/.vmodules
key: ${{ runner.os }}-${{ github.sha }}
fail-on-cache-miss: true
- name: Setup V
uses: vlang/setup-v@v1.3
- name: Setup Dependencies
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: libcurl4-openssl-dev
version: 1.0
- name: Build
run: v -cg -shared -cc ${{ matrix.cc }} ${{ matrix.optimization }} ${{ env.MOD_PATH }}
- name: Run tests
# TODO: investigate segfaults when running tests with gcc
if: (matrix.cc != 'gcc' && matrix.optimization != '') || (matrix.cc != 'clang' && matrix.optimization != '-prod')
uses: nick-fields/retry@v2
with:
timeout_minutes: 5
max_attempts: 3
command: v -cc ${{ matrix.cc }} ${{ matrix.optimization }} test ${{ env.MOD_PATH }}
test-sanitzed:
needs: different-compilers
runs-on: ubuntu-latest
strategy:
matrix:
cc: [gcc, clang]
sanitizer: [address, leak]
fail-fast: false
steps:
- name: Restore Cache
uses: actions/cache/restore@v3
with:
path: |
vlang
~/.vmodules
key: ${{ runner.os }}-${{ github.sha }}
fail-on-cache-miss: true
- name: Setup V
uses: vlang/setup-v@v1.3
- name: Setup Dependencies
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: libcurl4-openssl-dev
version: 1.0
- name: Run tests
uses: nick-fields/retry@v2
with:
timeout_minutes: 5
max_attempts: 3
command: |
if [[ ${{ matrix.cc }} == "gcc" ]] && [[ ${{ matrix.sanitizer }} == "address" ]]; then
v -cc gcc -cflags -fsanitize=address -cflags -fsanitize-address-use-after-scope -cflags -fsanitize=pointer-compare -cflags -fsanitize=pointer-subtract test ${{ env.MOD_PATH }}
else
v -cc ${{ matrix.cc }} -cflags -fsanitize=${{ matrix.sanitizer }} test ${{ env.MOD_PATH }}
fi