Repository navigation
100 lines (96 loc) · 3.04 KB
/
Copy pathci.yml
File metadata and controls
100 lines (96 loc) · 3.04 KB
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
name: GitHubCI
on:
push:
branches: ['**']
tags: ['v*']
pull_request:
branches: [master]
schedule:
- cron: '0 0 * * 6'
jobs:
linux-compile:
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
runs-on: ubuntu-latest
container: ubuntu:24.04
env:
CI_FORCE_TEST: '1'
steps:
- name: Install build dependencies
run: |
apt-get update -qq
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates git make libreadline-dev gcc-9 gcc-10 gcc-11 gcc-12 gcc-13 gcc-14 clang-14 clang-15 clang-16 clang-17 clang-18 clang-tidy-18
- uses: actions/checkout@v4
- name: Compile with GCC and Clang
run: |
export CFLAGS=-Werror
for compiler in gcc-9 gcc-10 gcc-11 gcc-12 gcc-13 gcc-14 clang-14 clang-15 clang-16 clang-17 clang-18; do
make clean
CC="$compiler" make strip
ls -l bcal
done
make clean
- name: Run clang-tidy
run: clang-tidy-18 inc/*.h src/*.c -- -Iinc
package-and-publish:
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') }}
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Create source archive
env:
TAG: ${{ github.ref_name }}
run: |
mkdir -p dist
project="${GITHUB_REPOSITORY##*/}"
git archive --format=tar.gz --prefix="${project}-${TAG#v}/" -o "dist/${project}-${TAG}.tar.gz" "$TAG"
- name: Publish GitHub release
env:
GH_TOKEN: ${{ github.token }}
TAG: ${{ github.ref_name }}
run: |
if gh release view "$TAG" >/dev/null 2>&1; then
gh release upload "$TAG" dist/* --clobber
else
gh release create "$TAG" dist/* --verify-tag --title "$TAG" --notes ''
fi
macOS-gcc:
if: ${{ github.event_name != 'schedule' && !startsWith(github.ref, 'refs/tags/') }}
runs-on: macOS-latest
steps:
- uses: actions/checkout@v4
- name: Compile with gcc
env:
CC: gcc
run: |
brew upgrade python
brew install pipx
pipx install logilab-common
pipx install pytest
make clean
make
pytest ./test.py
make clean
macOS-clang:
if: ${{ github.event_name != 'schedule' && !startsWith(github.ref, 'refs/tags/') }}
runs-on: macOS-latest
steps:
- uses: actions/checkout@v4
- name: Compile with clang
env:
CC: clang
run: |
brew update || true
brew install llvm || true
brew install pipx
pipx install logilab-common
pipx install pytest
brew unlink python@3.11 && brew link python@3.11
export PATH="/usr/local/opt/llvm/bin:$PATH"
export PATH="/opt/homebrew/opt/llvm/bin:$PATH"
make clean
make
pytest ./test.py
make clean
clang-tidy inc/*.h src/*.c -- -Iinc