nnn/.github/workflows/ci.yml
N-R-K 1e98e2e126 improve patch conflict ci script
goes through all different combinations automatically and makes adding
another patch easier by simply putting the name into the patches array.
2022-05-30 17:43:41 +06:00

55 lines
1.3 KiB
YAML

name: ci
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
macOS-gcc:
runs-on: macOS-latest
steps:
- uses: actions/checkout@v2
- name: Compile with gcc
env:
CC: gcc
run: |
export CFLAGS="$CFLAGS -Werror"
make clean
make
make clean
macOS-clang:
runs-on: macOS-latest
steps:
- uses: actions/checkout@v2
- name: Compile with clang
env:
CC: clang
run: |
brew update
brew install llvm
export PATH="/usr/local/opt/llvm/bin:$PATH"
export CFLAGS="$CFLAGS -Werror"
make clean
make
make clean
clang-tidy src/* -- -I/usr/include
macOS-patches:
runs-on: macOS-latest
steps:
- uses: actions/checkout@v2
- name: Compile patches with gcc
env:
CC: gcc
run: |
patches=("O_GITSTATUS" "O_NAMEFIRST" "O_RESTOREPREVIEW")
z=$(( 1 << ${#patches[@]} ))
for ((n=1; n < z; ++n)); do
for ((i=0; i < ${#patches[@]}; ++i)); do
printf "%s=%d " "${patches[$i]}" "$(( (n & (1 << i)) != 0 ))"
done | tee "tmp" ; echo
make clean
xargs make <"tmp"
done