i3status/.github/workflows/main.yml
Michael Stapelberg 07ad5aef2d GitHub Actions: update to clang-format 12
clang-format-6.0 is no longer installable
2023-01-07 09:48:49 +01:00

37 lines
1.3 KiB
YAML

name: CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
name: build and test
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
compiler: [gcc, clang]
steps:
- uses: actions/checkout@v2
- name: install build dependencies
run: sudo apt update && sudo apt install clang-format-12 libconfuse-dev libyajl-dev libasound2-dev libpulse-dev libnl-genl-3-dev asciidoc xmlto libcap2-bin pulseaudio meson
- name: Ensure all files were formatted as per clang-format
run: |
clang-format-12 -i $(find . -name "*.[ch]" | tr '\n' ' ') && git diff --exit-code || (echo 'Code was not formatted using clang-format!'; false)
- name: build
run: |
mkdir -p build && cd build && meson -Dmans=true .. && ninja -v && ldd ./i3status |& grep -q pulse || (echo "not linked against pulseaudio"; exit 1)
ninja clean && meson -Dmans=true -Dpulseaudio=false -Db_sanitize=address .. && ninja -v && ldd ./i3status |& grep -q pulse && (echo "linked against pulseaudio"; exit 1) || true
- name: run tests
# percentliteral-volume fails on GitHub Actions because the environment
# has no ALSA master device.
run: rm -rf testcases/020-percentliteral-volume && cd build && ninja -v test || (cat meson-logs/testlog.txt; false)