Skip to content

Commit 965d839

Browse files
committed
ci: add universal-ctags build-from-source matrix
Build universal-ctags from source alongside git, using the same pattern (cache + artifact + per-runner build). Two versions: - p5.9.20210829.0: Ubuntu 22.04/24.04 LTS default (2021 snapshot) - v6.2.1: latest stable, matches Homebrew and Alpine Edge Uses --program-prefix=universal- and --enable-json to match the existing install-ctags-alpine.sh flags. Test matrix is now 8 runners × 4 git versions × 2 ctags versions = 64 combinations.
1 parent d29e2f8 commit 965d839

1 file changed

Lines changed: 76 additions & 7 deletions

File tree

.github/workflows/ci.yml

Lines changed: 76 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ jobs:
1111
outputs:
1212
runners: ${{ steps.matrix.outputs.runners }}
1313
git-versions: ${{ steps.matrix.outputs.git-versions }}
14+
ctags-versions: ${{ steps.matrix.outputs.ctags-versions }}
1415
steps:
1516
- name: Define matrix
1617
id: matrix
@@ -22,6 +23,10 @@ jobs:
2223
# 2.47.3 — Debian 13 (Trixie) + Alpine 3.21, ships 1:2.47.3-0+deb13u1, also failing in #1029
2324
# 2.53.0 — Latest stable (2026-02-02), first version with cat-file --batch --filter= (added in 2.50.0)
2425
echo 'git-versions=["2.34.1","2.39.5","2.47.3","2.53.0"]' >> "$GITHUB_OUTPUT"
26+
# Universal-ctags versions to test against:
27+
# p5.9.20210829.0 — Ubuntu 22.04/24.04 LTS, ships 5.9.20210829.0-1 (2021-08-29 snapshot)
28+
# v6.2.1 — Latest stable, matches Homebrew and Alpine Edge
29+
echo 'ctags-versions=["p5.9.20210829.0","v6.2.1"]' >> "$GITHUB_OUTPUT"
2530
2631
build-git:
2732
needs: init
@@ -79,15 +84,68 @@ jobs:
7984
path: ~/git-install
8085
retention-days: 1
8186

87+
build-ctags:
88+
needs: init
89+
strategy:
90+
fail-fast: false
91+
matrix:
92+
runner: ${{ fromJSON(needs.init.outputs.runners) }}
93+
ctags-version: ${{ fromJSON(needs.init.outputs.ctags-versions) }}
94+
runs-on: ${{ matrix.runner }}
95+
name: build-ctags (${{ matrix.runner }}, ctags ${{ matrix.ctags-version }})
96+
steps:
97+
- name: Cache ctags build
98+
id: cache-ctags
99+
uses: actions/cache@v5.0.4
100+
with:
101+
path: ~/ctags-install
102+
key: ctags-${{ matrix.ctags-version }}-${{ matrix.runner }}
103+
104+
- name: Install build dependencies (Linux)
105+
if: runner.os == 'Linux' && steps.cache-ctags.outputs.cache-hit != 'true'
106+
run: |
107+
sudo apt-get update
108+
sudo apt-get install -y gcc make pkg-config autoconf automake libjansson-dev libyaml-dev libxml2-dev
109+
110+
- name: Install build dependencies (macOS)
111+
if: runner.os == 'macOS' && steps.cache-ctags.outputs.cache-hit != 'true'
112+
run: brew install autoconf automake pkg-config jansson libyaml pcre2
113+
114+
- name: Build universal-ctags from source
115+
if: steps.cache-ctags.outputs.cache-hit != 'true'
116+
run: |
117+
curl -fsSL "https://github.com/universal-ctags/ctags/archive/refs/tags/${{ matrix.ctags-version }}.tar.gz" | tar xz
118+
cd ctags-*/
119+
120+
NPROC=$(nproc 2>/dev/null || sysctl -n hw.ncpu)
121+
122+
./autogen.sh
123+
./configure --prefix="$HOME/ctags-install" --program-prefix=universal- --enable-json
124+
make -j"$NPROC"
125+
make install
126+
127+
- name: Verify ctags build
128+
run: |
129+
"$HOME/ctags-install/bin/universal-ctags" --version
130+
"$HOME/ctags-install/bin/universal-ctags" --version | grep -q "Universal Ctags"
131+
132+
- name: Upload ctags binaries
133+
uses: actions/upload-artifact@v7.0.0
134+
with:
135+
name: ctags-${{ matrix.ctags-version }}-${{ matrix.runner }}
136+
path: ~/ctags-install
137+
retention-days: 1
138+
82139
test:
83-
needs: [init, build-git]
140+
needs: [init, build-git, build-ctags]
84141
strategy:
85142
fail-fast: false
86143
matrix:
87144
runner: ${{ fromJSON(needs.init.outputs.runners) }}
88145
git-version: ${{ fromJSON(needs.init.outputs.git-versions) }}
146+
ctags-version: ${{ fromJSON(needs.init.outputs.ctags-versions) }}
89147
runs-on: ${{ matrix.runner }}
90-
name: test (${{ matrix.runner }}, git ${{ matrix.git-version }})
148+
name: test (${{ matrix.runner }}, git ${{ matrix.git-version }}, ctags ${{ matrix.ctags-version }})
91149
steps:
92150
- name: Checkout
93151
uses: actions/checkout@v6.0.2
@@ -108,20 +166,31 @@ jobs:
108166
chmod -R +x "$HOME/git-install/bin" "$HOME/git-install/libexec"
109167
echo "$HOME/git-install/bin" >> "$GITHUB_PATH"
110168
111-
- name: Install universal-ctags (Linux)
169+
- name: Download ctags binaries
170+
uses: actions/download-artifact@v8.0.1
171+
with:
172+
name: ctags-${{ matrix.ctags-version }}-${{ matrix.runner }}
173+
path: ~/ctags-install
174+
175+
- name: Add ctags to PATH
176+
run: |
177+
chmod -R +x "$HOME/ctags-install/bin"
178+
echo "$HOME/ctags-install/bin" >> "$GITHUB_PATH"
179+
180+
- name: Install ctags runtime dependencies (Linux)
112181
if: runner.os == 'Linux'
113-
run: sudo apt-get update && sudo apt-get install -y universal-ctags
182+
run: sudo apt-get update && sudo apt-get install -y libjansson4 libyaml-0-2 libxml2
114183

115-
- name: Install universal-ctags (macOS)
184+
- name: Install ctags runtime dependencies (macOS)
116185
if: runner.os == 'macOS'
117-
run: brew install universal-ctags
186+
run: brew install jansson libyaml pcre2
118187

119188
- name: Print versions
120189
run: |
121190
go version
122191
git --version
123192
git --version | grep -q "${{ matrix.git-version }}"
124-
universal-ctags --version || true
193+
universal-ctags --version
125194
126195
- name: Test
127196
run: go test ./...

0 commit comments

Comments
 (0)