Skip to content

fix lint

fix lint #22

Workflow file for this run

name: ci
on:
push: {branches-ignore: [latest], tags: ['*']}
pull_request:
env:
PACKAGE_NAME: ${{ github.event.repository.name }}
PACKAGE_VERSION: ${{ github.sha }}
jobs:
##### coverage #####
coverage:
runs-on: ubuntu-latest
container: debian:bullseye
name: coverage - measure
env:
linux_distro: debian
linux_release: bullseye
steps:
- name: add cppfw deb repo
uses: myci-actions/add-deb-repo@master
with:
repo: deb https://gagis.hopto.org/repo/cppfw/${{ env.linux_distro }} ${{ env.linux_release }} main
repo-name: cppfw
keys-asc: https://gagis.hopto.org/repo/cppfw/pubkey.gpg
install: myci locales git
- name: add llvm repo (for clang-format)
uses: myci-actions/add-deb-repo@master
with:
repo: deb https://apt.llvm.org/${{ env.linux_release }} llvm-toolchain-${{ env.linux_release }} main
repo-name: llvm
keys-asc: https://apt.llvm.org/llvm-snapshot.gpg.key
- name: install ci tools
run: |
apt --quiet install --assume-yes devscripts equivs python3-pip
# install gcovr >5.2
pip install git+https://github.com/gcovr/gcovr.git
- name: git clone
uses: myci-actions/checkout@master
- name: prepare debian package
run: myci-deb-prepare.sh
- name: install deps
run: myci-deb-install-build-deps.sh
- name: build
run: make config=gcov
- name: test
run: make config=gcov test
- name: generate coverage report
run: gcovr --exclude-throw-branches --filter src/ --cobertura > cobertura.xml
- name: upload coverage report to artifacts
uses: actions/upload-artifact@v4
with:
name: cobertura.xml
path: cobertura.xml
- name: upload coverage data to codecov.io
uses: codecov/[email protected]
if: always() # even if previous steps fail, this one needs to be run
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: cobertura.xml
# flags: unittests # optional
name: codecov-umbrella # optional
fail_ci_if_error: true # optional (default = false)
verbose: true # optional (default = false)
##### sanitizer #####
sanitizer:
strategy:
fail-fast: false
matrix:
include:
- {os: debian, codename: bullseye, image_owner: }
# - {os: debian, codename: bullseye, image_owner: arm32v7/, labels: [arm,docker]}
runs-on: ${{ (matrix.labels == '' && 'ubuntu-latest') || matrix.labels }}
container: ${{ matrix.image_owner }}${{ matrix.os }}:${{ matrix.codename }}
name: sanitizer - ${{ matrix.image_owner }}${{ matrix.os }}:${{ matrix.codename }}
steps:
- name: add cppfw deb repo
uses: myci-actions/add-deb-repo@master
with:
repo: deb https://gagis.hopto.org/repo/cppfw/${{ matrix.os }} ${{ matrix.codename }} main
repo-name: cppfw
keys-asc: https://gagis.hopto.org/repo/cppfw/pubkey.gpg
install: myci locales git
- name: add llvm repo (for clang-format)
uses: myci-actions/add-deb-repo@master
with:
repo: deb https://apt.llvm.org/${{ matrix.codename }} llvm-toolchain-${{ matrix.codename }} main
repo-name: llvm
keys-asc: https://apt.llvm.org/llvm-snapshot.gpg.key
- name: install ci tools
run: |
apt --quiet install --assume-yes devscripts equivs
- name: git clone
uses: myci-actions/checkout@master
- name: prepare debian package
run: myci-deb-prepare.sh
- name: install deps
run: myci-deb-install-build-deps.sh
- name: build
run: make config=asan
- name: test
run: make config=asan test
##### deb linux #####
deb:
strategy:
fail-fast: false
matrix:
include:
- {os: debian, codename: bullseye, image_owner: }
# - {os: debian, codename: bullseye, image_owner: i386/, labels: [i386,docker]}
- {os: debian, codename: bullseye, image_owner: arm32v7/, labels: [arm,docker]}
- {os: debian, codename: bullseye, image_owner: arm64v8/, labels: [arm64,docker]}
- {os: debian, codename: bookworm, image_owner: }
# - {os: debian, codename: bookworm, image_owner: i386/, labels: [i386,docker]}
- {os: debian, codename: bookworm, image_owner: arm32v7/, labels: [arm,docker]}
- {os: debian, codename: bookworm, image_owner: arm64v8/, labels: [arm64,docker]}
# - {os: ubuntu, codename: focal, image_owner: }
- {os: ubuntu, codename: jammy, image_owner: }
- {os: raspbian, codename: bullseye, image_owner: igagis/, labels: [arm,docker]}
- {os: raspbian, codename: bookworm, image_owner: igagis/, labels: [arm,docker]}
runs-on: ${{ (matrix.labels == '' && 'ubuntu-latest') || matrix.labels }}
container: ${{ matrix.image_owner }}${{ matrix.os }}:${{ matrix.codename }}
name: linux - ${{ matrix.image_owner }}${{ matrix.os }}:${{ matrix.codename }}
steps:
- name: add cppfw deb repo
uses: myci-actions/add-deb-repo@master
with:
repo: deb https://gagis.hopto.org/repo/cppfw/${{ matrix.os }} ${{ matrix.codename }} main
repo-name: cppfw
keys-asc: https://gagis.hopto.org/repo/cppfw/pubkey.gpg
install: myci locales git
- name: add llvm repo (for clang-format)
uses: myci-actions/add-deb-repo@master
with:
repo: deb https://apt.llvm.org/${{ matrix.codename }} llvm-toolchain-${{ matrix.codename }} main
repo-name: llvm
keys-asc: https://apt.llvm.org/llvm-snapshot.gpg.key
- name: install ci tools
run: |
# configure timezone to avoid 'tzdata' package to require user interaction during installation (needed for ubuntu:focal)
TZ=Europe/Helsinki ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
apt --quiet install --assume-yes devscripts equivs
- name: git clone
uses: myci-actions/checkout@master
- name: set PACKAGE_VERSION
uses: myci-actions/export-env-var@master
with: {name: PACKAGE_VERSION, value: $(myci-deb-version.sh debian/changelog)}
- name: prepare debian package
run: myci-deb-prepare.sh
- name: install deps
run: myci-deb-install-build-deps.sh
- name: build
run: dpkg-buildpackage --unsigned-source --unsigned-changes
# - name: upload binaries to artifacts
# uses: actions/[email protected]
# with:
# name: binaries-${{ matrix.image_owner }}${{ matrix.os }}:${{ matrix.codename }}
# path: |
# src/out/rel/*.so.*
# src/out/rel/*.a
- name: deploy deb packages
run: |
echo "${{ secrets.MYCI_REPO_SSH_KEY }}" > repo_key_rsa && chmod 600 repo_key_rsa
myci-deploy-apt-ssh.sh --key repo_key_rsa --server gagis.hopto.org --repo gagistech/${{ matrix.os }} --distro ${{ matrix.codename }} --component main ../*_${PACKAGE_VERSION}_*.deb
if: startsWith(github.ref, 'refs/tags/')