Fix findings from Dmitry's review #1221
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: Run clang-format | |
if: matrix.os == 'ubuntu-latest' | |
uses: jidicula/clang-format-action@v4.13.0 | |
with: | |
clang-format-version: '18' | |
check-path: 'src' | |
exclude-regex: 'tinytest.h' | |
# Check param formatting. | |
# Only need to check this once. | |
- name: Check param formatting | |
if: matrix.os == 'ubuntu-latest' | |
run: | | |
python3 ../scripts/format_c_params.py | |
git diff --exit-code | |
# Run tests. | |
- 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 |