Skip to content

Commit 938ea85

Browse files
committed
Add CI
Assisted-by: Cursor
1 parent b843719 commit 938ea85

1 file changed

Lines changed: 119 additions & 0 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ master, main ]
6+
pull_request:
7+
branches: [ master, main ]
8+
9+
jobs:
10+
test:
11+
runs-on: ${{ matrix.os }}
12+
strategy:
13+
matrix:
14+
os: [ubuntu-latest, ubuntu-20.04]
15+
include:
16+
- os: ubuntu-latest
17+
cc: gcc
18+
- os: ubuntu-20.04
19+
cc: gcc
20+
21+
steps:
22+
- uses: actions/checkout@v4
23+
24+
- name: Install dependencies
25+
run: |
26+
sudo apt-get update
27+
sudo apt-get install -y \
28+
autoconf \
29+
automake \
30+
build-essential \
31+
perl \
32+
patch \
33+
diffutils \
34+
xmlto \
35+
libpcre2-dev
36+
37+
- name: Bootstrap
38+
run: ./bootstrap
39+
40+
- name: Configure
41+
run: |
42+
./configure \
43+
--with-pcre2 \
44+
CC=${{ matrix.cc }}
45+
46+
- name: Build
47+
run: make -j$(nproc)
48+
49+
- name: Run tests
50+
run: make check
51+
52+
- name: Show test results on failure
53+
if: failure()
54+
run: |
55+
echo "=== Test logs ==="
56+
find . -name "*.log" -type f -exec echo "=== {} ===" \; -exec cat {} \;
57+
echo "=== Test arena contents ==="
58+
find test-arena -type f 2>/dev/null | head -20 | while read f; do
59+
echo "=== $f ==="
60+
cat "$f" 2>/dev/null || echo "Cannot read file"
61+
done
62+
63+
test-without-pcre2:
64+
runs-on: ubuntu-latest
65+
steps:
66+
- uses: actions/checkout@v4
67+
68+
- name: Install dependencies (without PCRE2)
69+
run: |
70+
sudo apt-get update
71+
sudo apt-get install -y \
72+
autoconf \
73+
automake \
74+
build-essential \
75+
perl \
76+
patch \
77+
diffutils \
78+
xmlto
79+
80+
- name: Bootstrap
81+
run: ./bootstrap
82+
83+
- name: Configure without PCRE2
84+
run: ./configure --without-pcre2
85+
86+
- name: Build
87+
run: make -j$(nproc)
88+
89+
- name: Run tests
90+
run: make check
91+
92+
test-distcheck:
93+
runs-on: ubuntu-latest
94+
steps:
95+
- uses: actions/checkout@v4
96+
97+
- name: Install dependencies
98+
run: |
99+
sudo apt-get update
100+
sudo apt-get install -y \
101+
autoconf \
102+
automake \
103+
build-essential \
104+
perl \
105+
patch \
106+
diffutils \
107+
xmlto \
108+
libpcre2-dev
109+
110+
- name: Bootstrap
111+
run: ./bootstrap
112+
113+
- name: Configure
114+
run: ./configure --with-pcre2
115+
116+
- name: Build and test distribution
117+
run: make distcheck
118+
119+

0 commit comments

Comments
 (0)