-
Notifications
You must be signed in to change notification settings - Fork 403
34 lines (31 loc) · 1010 Bytes
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
name: GitHub Actions
on:
push:
pull_request:
jobs:
build:
name: build and test
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
compiler: [gcc, clang]
env:
CC: ${{ matrix.compiler }}
steps:
- uses: actions/checkout@v2
- run: git fetch --prune --unshallow
- name: fetch or build Docker container
run: |
docker build --pull --no-cache --rm -t=i3lock -f ci/Dockerfile .
docker run -e CC -v $PWD:/usr/src:rw i3lock /bin/sh -c 'git config --global --add safe.directory /usr/src && mkdir build && cd build && CFLAGS="-Wformat -Wformat-security -Wextra -Wno-unused-parameter -Werror" meson .. && ninja'
formatting:
name: Check formatting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install dependencies
run: |
sudo apt-get install -y clang-format-15
- name: Check formatting
run: clang-format-15 --dry-run --Werror $(git ls-files '*.c' 'include/*.h')