c-kzg-4844/.github/workflows/c-tests.yml

77 lines
1.7 KiB
YAML

name: C
on:
push:
branches:
- main
pull_request:
branches:
- main
defaults:
run:
shell: bash
working-directory: src
jobs:
tests:
runs-on: ${{matrix.os}}
strategy:
matrix:
os:
- ubuntu-latest
- macos-latest
- windows-latest
steps:
# Checkout repository and blst submodule.
- uses: actions/checkout@v3
with:
submodules: recursive
# Check formatting.
# Only need to check this once.
- name: Check formatting
if: matrix.os == 'ubuntu-latest'
run: |
make format
git diff --exit-code
# Build and test.
- name: Build
run: make test_c_kzg_4844
- name: Test
run: make test
# Run sanitizers.
# Doesn't work on Windows.
- name: Clang Sanitizers
if: matrix.os != 'windows-latest'
run: make sanitize
# Run static analyzer.
# Doesn't work on Windows.
- name: Clang Static Analyzer
if: matrix.os != 'windows-latest'
run: make analyze
# Install LLVM for coverage report.
# Already installed on macOS.
# Doesn't work on Windows.
- name: Install LLVM
if: matrix.os == 'ubuntu-latest'
uses: egor-tensin/setup-clang@v1
# Generate the coverage report.
# Doesn't work on Windows.
- name: Generate coverage report
if: matrix.os != 'windows-latest'
run: make coverage
# Upload the coverage report.
# Didn't generate it for Windows.
- name: Save coverage report
if: matrix.os != 'windows-latest'
uses: actions/upload-artifact@v3
with:
name: coverage
path: src/coverage.html