-
Notifications
You must be signed in to change notification settings - Fork 2
177 lines (160 loc) · 4.89 KB
/
ci.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
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
# This is the continuous integration job for `mpdpopm`. It will run on
# both MacOS & Ubuntu, using various versions of Rust: a "pinned"
# version representing the least-supported, the current stable & the
# current nightly.
name: Continuous Integration
on:
workflow_dispatch:
pull_request:
types: [opened, edited, reopened] # don't say `synchronize`-- that is taken care of by `push`
push:
schedule:
- cron: '00 01 * * *'
jobs:
build:
name: build
strategy:
matrix:
rust-build:
- pinned
- stable
- nightly
os: [ubuntu-22.04, macos-12]
include:
- rust-build: pinned
os: ubuntu-22.04
# 1.56.0 was the first to support 2021 edition
# 1.58 -- required by cargo-deb...
# but it seems a cargo-deb dependency (rayon-core) needs 1.59,
# whereas another (`log1) requires 1.60, and the `cargo-deb`
# README says 1.63. Dependency `toml_edit` needs 1.64!
# ...and dependency `addr2line` now needs 1.65 (2023-08-23)
rust: 1.65
- rust-build: stable
os: ubuntu-22.04
rust: stable
- rust-build: nightly
os: ubuntu-22.04
rust: nightly
- rust-build: pinned
os: macos-12
rust: 1.65
- rust-build: stable
os: macos-12
rust: stable
- rust-build: nightly
os: macos-12
rust: nightly
runs-on: ${{ matrix.os }}
env:
RUST_BACKTRACE: 1
steps:
- name: Checkout repo
uses: actions/checkout@v3
# This is cheap, so do it early. I'd hate to install Rust, Eamcs,
# Tex &c only to find-out I'd forgotten a code TODO.
- name: Check for TODO-s
shell: bash
run: |
set -x
# `ripgrep` needs rust 1.70 to compile, but I stubbornly refuse
# to upgrade my "pinned" rust version!
# if rg -t rust 'TODO|TOOD|LATER|\\todo|todo!|dbg!'; then
if find . -iname '*.rs' -print0|xargs -0 grep -E 'TODO|TOOD|LATER|\\todo|todo!|dbg!'; then
echo "You have TODO-s"
exit 1
fi
- name: Install Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
- name: Install Tools (Ubuntu)
if: matrix.os == 'ubuntu-22.04'
shell: bash
run: |
pwd
set -x
set -e
sudo apt-get update
sudo apt-get install -y autoconf automake emacs liblzma-dev texlive
- name: Install Tools (macOS)
if: matrix.os == 'macos-12'
shell: bash
run: |
set -x
# This seems wrong on multiple levels, but see here:
# <https://github.com/orgs/Homebrew/discussions/4612#discussioncomment-6339258>
set +e
pwd
brew cleanup
# Will exit with non-zero status if it finds problems, but can be handy
# for trouble-shooting:
brew doctor
brew update
brew upgrade
set -e
brew install autoconf automake emacs
brew install --cask basictex
- name: Install a modern version of Texinfo
if: matrix.os == 'macos-12'
shell: bash
run: |
set -x
mkdir tmp && cd tmp
# TODO(sp1ff): cache this
curl -L -O https://ftp.gnu.org/gnu/texinfo/texinfo-7.0.2.tar.gz
tar xf texinfo-7.0.2.tar.gz
cd texinfo-7.0.2
./configure
make
make install
type -p texi2dvi
texi2dvi --version
- name: Install additional Rust tooling
shell: bash
run: |
cargo install --verbose --version=1.44.0 --locked cargo-deb
- name: Configure mpdpopm
shell: bash
run: |
set -ex
./bootstrap && ./configure
- name: Build mpdpopm
run: make
# Copied verbatim from ripgrep. BurntSushi says "This is useful
# for debugging problems when the expected build artifacts (like
# shell completions and man pages) aren't generated."
- name: Show build.rs stderr
shell: bash
run: |
set -x
cd mpdpopm
pwd
stderr="$(find target/release -name stderr -print0 | xargs -0 ls -t | head -n1)"
if [ -s "$stderr" ]; then
echo "===== $stderr ===== "
cat "$stderr"
echo "====="
fi
- name: Run unit test suite
shell: bash
run: |
set -x
make check
- name: Check the Autotools distribution (Ubuntu)
if: matrix.os == 'ubuntu-22.04'
shell: bash
run: make distcheck
- name: Check the Autotools distribution (MacOS)
if: matrix.os == 'macos-12'
shell: bash
run: |
eval "$(/usr/libexec/path_helper)"
make distcheck
- name: Check the Debian package
if: matrix.os == 'ubuntu-22.04'
shell: bash
run: |
set -x
cd mpdpopm
cargo deb