Update copyright notices, upgrade to nixos-24.05 #24
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: ci | |
on: | |
push: | |
branches: | |
- master | |
- dev-1.x | |
- develop | |
pull_request: | |
branches: | |
- master | |
jobs: | |
linux: | |
runs-on: ${{ matrix.DISTRO }} | |
strategy: | |
fail-fast: false | |
matrix: | |
DISTRO: | |
- "ubuntu-20.04" | |
- "ubuntu-22.04" | |
- "ubuntu-latest" | |
CC: | |
- "gcc" | |
- "clang" | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Install packages | |
run: sudo apt-get install -y autotools-dev autoconf automake bats libtool m4 make pkg-config check libpcre3-dev libtalloc-dev libsubunit-dev lcov libjson-c-dev liblmdb-dev libyaml-dev ${{ matrix.CC }} | |
- run: autoreconf -i | |
- run: ./configure | |
env: | |
CC: ${{ matrix.CC }} | |
# json-c undeprecated json_object_object_get, but the version in xenial | |
# is too old, so let's silence deprecated warnings. le sigh. | |
CFLAGS: "-Wno-deprecated-declarations -Wno-error=deprecated-declarations" | |
- run: make | |
- run: make check | |
- run: make distcheck | |
- name: dump logs | |
if: ${{ failure() }} | |
run: | | |
for i in `find tests -name "*.log" 2>/dev/null`; do | |
echo "-- START ${i}"; | |
cat "${i}"; | |
echo "-- END"; | |
done | |
linux_coverage: | |
runs-on: ${{ matrix.DISTRO }} | |
strategy: | |
fail-fast: false | |
matrix: | |
DISTRO: | |
- "ubuntu-20.04" | |
- "ubuntu-22.04" | |
- "ubuntu-latest" | |
CC: | |
- "gcc" | |
# - "clang" | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Install packages | |
run: sudo apt-get install -y autotools-dev autoconf automake bats libtool m4 make pkg-config check libpcre3-dev libtalloc-dev libsubunit-dev lcov libjson-c-dev liblmdb-dev libyaml-dev lcov ${{ matrix.CC }} | |
- run: autoreconf -i | |
- run: ./configure --enable-code-coverage | |
env: | |
CC: ${{ matrix.CC }} | |
# json-c undeprecated json_object_object_get, but the version in xenial | |
# is too old, so let's silence deprecated warnings. le sigh. | |
CFLAGS: "-Wno-deprecated-declarations -Wno-error=deprecated-declarations" | |
- run: make | |
- run: make check | |
- run: make code-coverage-capture | |
- name: Coveralls | |
# if: ${{ matrix.COVERAGE == 'true' }} | |
uses: coverallsapp/github-action@master | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
path-to-lcov: ./handlebars-coverage.info | |
- name: dump logs | |
if: ${{ failure() }} | |
run: | | |
for i in `find tests -name "*.log" 2>/dev/null`; do | |
echo "-- START ${i}"; | |
cat "${i}"; | |
echo "-- END"; | |
done | |
linux_scanbuild: | |
runs-on: ${{ matrix.DISTRO }} | |
strategy: | |
fail-fast: false | |
matrix: | |
DISTRO: | |
- "ubuntu-20.04" | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Install packages | |
run: sudo apt-get install -y autotools-dev autoconf automake bats libtool m4 make pkg-config check libpcre3-dev libtalloc-dev libsubunit-dev lcov libjson-c-dev liblmdb-dev libyaml-dev clang-tools html2text | |
- run: autoreconf -i | |
- run: scan-build ./configure | |
env: | |
# json-c undeprecated json_object_object_get, but the version in xenial | |
# is too old, so let's silence deprecated warnings. le sigh. | |
CFLAGS: "-Wno-deprecated-declarations -Wno-error=deprecated-declarations" | |
- run: scan-build -o scan-build make | |
- name: check for issues | |
run: | | |
if [ -n "$(find scan-build -name '*.html')" ]; then | |
echo "scan-build found potential issues" | |
find scan-build -name 'index.html' -print -exec html2text \{} \; | |
exit 1 | |
fi | |
- uses: actions/upload-artifact@v4 | |
if: failure() | |
with: | |
name: scan-build | |
path: scan-build | |
build_osx_autotools_default_args: | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Install packages | |
run: brew install autoconf automake bats-core json-c libtool libyaml lmdb pkg-config talloc check lcov pcre | |
- name: create configure | |
run: autoreconf -i | |
- name: configure | |
# disabling compiler warnings as error because of some weird issue with libtool and '-Wl,-fatal_warnings' | |
run: ./configure --disable-bison --disable-flex --disable-gperf --enable-compile-warnings=yes | |
- name: make | |
run: make | |
- name: make check | |
run: make check | |
- name: make distcheck | |
run: make distcheck DISTCHECK_CONFIGURE_FLAGS="--disable-bison --disable-flex --disable-gperf --enable-compile-warnings=yes" | |
- name: dump logs | |
if: ${{ failure() }} | |
run: | | |
for i in `find tests -name "*.log" 2>/dev/null`; do | |
echo "-- START ${i}"; | |
cat "${i}"; | |
echo "-- END"; | |
done | |
nix-matrix: | |
runs-on: ubuntu-latest | |
outputs: | |
matrix: ${{ steps.set-matrix.outputs.matrix }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: cachix/install-nix-action@v27 | |
with: | |
nix_path: nixpkgs=channel:nixos-24.05 | |
extra_nix_config: "system-features = nixos-test benchmark big-parallel kvm" | |
- id: set-matrix | |
name: Generate Nix Matrix | |
run: | | |
set -Eeu | |
matrix="$(nix eval --json '.#githubActions.matrix')" | |
echo "matrix=$matrix" >> "$GITHUB_OUTPUT" | |
nix: | |
name: "nix (${{ matrix.name }})" | |
runs-on: ${{ matrix.os }} | |
needs: nix-matrix | |
strategy: | |
matrix: ${{fromJSON(needs.nix-matrix.outputs.matrix)}} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set Up Build Cache | |
uses: actions/cache@v4 | |
id: nix-cache | |
with: | |
path: /tmp/nix-store.nar | |
key: nix-store.nar-${{ runner.os }}-${{ hashFiles('flake.lock') }}-${{ matrix.attr }} | |
restore-keys: | | |
nix-store.nar-${{ runner.os }}-${{ hashFiles('flake.lock') }}-${{ matrix.attr }} | |
nix-store.nar-${{ runner.os }}-${{ hashFiles('flake.lock') }}- | |
nix-store.nar-${{ runner.os }}- | |
- uses: cachix/install-nix-action@v27 | |
with: | |
nix_path: nixpkgs=channel:nixos-24.05 | |
extra_nix_config: "system-features = nixos-test benchmark big-parallel kvm" | |
- name: Import Nix Store Cache | |
if: "steps.nix-cache.outputs.cache-hit == 'true'" | |
run: | | |
nix-store --import < /tmp/nix-store.nar | |
- run: sudo sysctl -w kernel.perf_event_paranoid=1 | |
- run: nix build -L ".#${{ matrix.attr }}" | |
# - run: nix flake check -L | |
# broken sigh | |
# - name: Export Nix Store Cache | |
# shell: bash | |
# # partially based on https://github.com/NixOS/nix/issues/1245#issuecomment-282586759 | |
# run: | | |
# drv="$(nix-store -qd "$(readlink result)")" | |
# drvRefs="$( echo "$drv" | xargs nix-store -q --references )" | |
# ( echo "$drvRefs" | grep '[.]drv$' | xargs nix-store -q --outputs ; | |
# echo "$drvRefs" | grep -v '[.]drv$' ) | \ | |
# xargs nix-store -r | \ | |
# xargs nix-store -qR | | |
# xargs nix-store --export > /tmp/nix-store.nar |