Skip to content

Fixed friction suggestions (#144) #21

Fixed friction suggestions (#144)

Fixed friction suggestions (#144) #21

Workflow file for this run

name: Zig CI
on:
push:
branches:
- master
paths:
- 'zig-lib/**'
- 'conformance/certs/**'
- 'tools/coverage/**'
- '.github/workflows/zig.yml'
pull_request:
branches:
- master
paths:
- 'zig-lib/**'
- 'conformance/certs/**'
- 'tools/coverage/**'
- '.github/workflows/zig.yml'
defaults:
run:
working-directory: zig-lib
jobs:
test:
name: Build & test (zig build test)
# Ubuntu 24.04 runners do not publish a kcov package; keep this job on
# 22.04 until Zig coverage no longer depends on distro kcov.
runs-on: ubuntu-22.04
timeout-minutes: 15
steps:
- uses: actions/checkout@v7
- name: Install coverage/build dependencies
run: sudo apt-get update && sudo apt-get install -y kcov libssl-dev
# The library uses Zig 0.16's std.Io, so the version is pinned.
- uses: mlugg/setup-zig@v2
with:
version: 0.16.0
- uses: extractions/setup-just@v4
# `just coverage` builds Zig test binaries, runs them under kcov, and
# writes LCOV for the protocol unit tests + TCP/TLS integration test.
- name: Test with coverage
run: just coverage
- name: Check coverage report
id: coverage
run: |
if awk -F: '/^LF:/ { total += $2 } END { exit !(total > 0) }' coverage.lcov; then
echo "has-coverage=true" >> "$GITHUB_OUTPUT"
else
echo "::warning::Zig coverage report is empty; skipping Coveralls upload"
echo "has-coverage=false" >> "$GITHUB_OUTPUT"
fi
- name: Upload coverage to Coveralls
if: steps.coverage.outputs.has-coverage == 'true'
uses: coverallsapp/github-action@v2
with:
file: zig-lib/coverage.lcov
flag-name: zig