Skip to content

feat: S1.1 walking skeleton — RFC 5424 message validated field by field #15

feat: S1.1 walking skeleton — RFC 5424 message validated field by field

feat: S1.1 walking skeleton — RFC 5424 message validated field by field #15

Workflow file for this run

name: CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
permissions:
contents: read
jobs:
build-and-test:
runs-on: ubuntu-latest
permissions:
contents: read
checks: write
pull-requests: write
container:
image: ghcr.io/davidcozens/cpputest:sha-e7aa8a1
options: --user root
env:
GIT_CONFIG_COUNT: 1
GIT_CONFIG_KEY_0: safe.directory
GIT_CONFIG_VALUE_0: '*'
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: Configure
run: cmake --preset debug
- name: Build and test
run: cmake --build --preset debug --target junit
- name: Publish test results
uses: EnricoMi/publish-unit-test-result-action@c950f6fb443cb5af20a377fd0dfaa78838901040 # v2
if: always()
with:
files: build/debug/cpputest_*.xml
clang-build-and-test:
runs-on: ubuntu-latest
permissions:
contents: read
checks: write
pull-requests: write
container:
image: ghcr.io/davidcozens/cpputest-clang:sha-6ea3f95
options: --user root
env:
GIT_CONFIG_COUNT: 1
GIT_CONFIG_KEY_0: safe.directory
GIT_CONFIG_VALUE_0: '*'
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: Configure
run: cmake --preset clang-debug
- name: Build and test
run: cmake --build --preset clang-debug --target junit
- name: Publish test results
uses: EnricoMi/publish-unit-test-result-action@c950f6fb443cb5af20a377fd0dfaa78838901040 # v2
if: always()
with:
files: build/clang-debug/cpputest_*.xml
sanitize:
runs-on: ubuntu-latest
permissions:
contents: read
checks: write
pull-requests: write
container:
image: ghcr.io/davidcozens/cpputest:sha-e7aa8a1
options: --user root
env:
GIT_CONFIG_COUNT: 1
GIT_CONFIG_KEY_0: safe.directory
GIT_CONFIG_VALUE_0: '*'
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: Configure
run: cmake --preset sanitize
- name: Build and test
run: cmake --build --preset sanitize --target junit
- name: Publish test results
uses: EnricoMi/publish-unit-test-result-action@c950f6fb443cb5af20a377fd0dfaa78838901040 # v2
if: always()
with:
files: build/sanitize/cpputest_*.xml
coverage:
runs-on: ubuntu-latest
permissions:
contents: read
checks: write
pages: write
id-token: write
container:
image: ghcr.io/davidcozens/cpputest:sha-e7aa8a1
options: --user root
env:
GIT_CONFIG_COUNT: 1
GIT_CONFIG_KEY_0: safe.directory
GIT_CONFIG_VALUE_0: '*'
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: Configure
run: cmake --preset coverage
- name: Build and generate coverage report
run: cmake --build --preset coverage --target coverage
- name: Post coverage summary
run: |
echo '## Coverage Summary' >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
lcov --summary build/coverage/coverage.filtered.info --rc branch_coverage=1 2>&1 >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
- name: Enforce coverage thresholds
env:
LINE_THRESHOLD: 90
BRANCH_THRESHOLD: 90
run: |
SUMMARY=$(lcov --summary build/coverage/coverage.filtered.info --rc branch_coverage=1 2>&1)
LINE_COV=$(echo "$SUMMARY" | sed -n 's/.*lines\.*: \([0-9.]*\)%.*/\1/p')
BRANCH_COV=$(echo "$SUMMARY" | sed -n 's/.*branches\.*: \([0-9.]*\)%.*/\1/p')
FAIL=0
if [ -n "$LINE_COV" ]; then
echo "Line coverage: ${LINE_COV}% (threshold: ${LINE_THRESHOLD}%)"
if awk "BEGIN{exit !($LINE_COV < $LINE_THRESHOLD)}"; then
echo "FAIL: line coverage ${LINE_COV}% is below ${LINE_THRESHOLD}%"
FAIL=1
fi
else
echo "FAIL: could not determine line coverage"
FAIL=1
fi
if [ -n "$BRANCH_COV" ]; then
echo "Branch coverage: ${BRANCH_COV}% (threshold: ${BRANCH_THRESHOLD}%)"
if awk "BEGIN{exit !($BRANCH_COV < $BRANCH_THRESHOLD)}"; then
echo "FAIL: branch coverage ${BRANCH_COV}% is below ${BRANCH_THRESHOLD}%"
FAIL=1
fi
else
echo "Branch coverage: no branch data found (skipping threshold check)"
fi
exit $FAIL
- name: Upload pages artifact
if: github.ref == 'refs/heads/main'
uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3
with:
path: build/coverage/coverage_report/
deploy-coverage-pages:
needs: coverage
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4
tidy:
runs-on: ubuntu-latest
container:
image: ghcr.io/davidcozens/cpputest:sha-e7aa8a1
options: --user root
env:
GIT_CONFIG_COUNT: 1
GIT_CONFIG_KEY_0: safe.directory
GIT_CONFIG_VALUE_0: '*'
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: Configure
run: cmake --preset tidy
- name: Build with clang-tidy
run: cmake --build --preset tidy
format:
runs-on: ubuntu-latest
container:
image: ghcr.io/davidcozens/cpputest:sha-e7aa8a1
options: --user root
env:
GIT_CONFIG_COUNT: 1
GIT_CONFIG_KEY_0: safe.directory
GIT_CONFIG_VALUE_0: '*'
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: Check clang-format
run: |
find Interface Source Tests -name '*.c' -o -name '*.cpp' -o -name '*.h' \
| xargs clang-format --dry-run --Werror
cppcheck:
runs-on: ubuntu-latest
container:
image: ghcr.io/davidcozens/cpputest:sha-e7aa8a1
options: --user root
env:
GIT_CONFIG_COUNT: 1
GIT_CONFIG_KEY_0: safe.directory
GIT_CONFIG_VALUE_0: '*'
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: Configure
run: cmake --preset cppcheck
- name: Build with cppcheck
run: cmake --build --preset cppcheck