-
Notifications
You must be signed in to change notification settings - Fork 8
183 lines (154 loc) · 5.15 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
178
179
180
181
182
183
name: ci
on:
push:
env:
CARGO_TERM_COLOR: always
jobs:
codespell:
name: Codespell
runs-on: ubuntu-22.04
steps:
- name: Setup | Checkout rpm-sequoia
uses: actions/checkout@v2
- name: Setup | Dependencies
run: sudo apt update && sudo apt install codespell
- name: Codespell
run: codespell --version && codespell --config .codespellrc --summary
compile:
name: Compile
runs-on: ubuntu-latest
steps:
- name: Setup | Checkout rpm-sequoia
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup | Build Cache rpm-sequoia
uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Setup | Dependencies rpm-sequoia
run: sudo apt update && sudo apt install cargo clang git nettle-dev pkg-config libssl-dev
- name: Build | Compile rpm-sequoia
run: cargo build
- name: Build | Test rpm-sequoia
run: cargo test
- name: Build | Doc rpm-sequoia
run: cargo doc --no-deps
all_commits:
name: All Commits
runs-on: ubuntu-latest
needs: ["Compile"]
steps:
- name: Setup | Checkout rpm-sequoia
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup | Build Cache rpm-sequoia
uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Setup | Dependencies rpm-sequoia
run: sudo apt update && sudo apt install cargo clang git nettle-dev pkg-config libssl-dev
- name: Build | Compile rpm-sequoia
run: cargo build
- name: Build | Test other commits
run: .ci/all_commits.sh
rpm:
name: RPM
runs-on: ubuntu-latest
needs: ["Compile"]
steps:
- name: Setup | Checkout rpm-sequoia
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup | Build Cache rpm-sequoia
uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Setup | Dependencies rpm-sequoia
run: sudo apt update && sudo apt install cargo clang git nettle-dev pkg-config libssl-dev
- name: Build | Compile rpm-sequoia
run: cargo build
- name: Setup | rpm Dependencies
run: sudo apt install automake autoconf autopoint gettext libtool tar zlib1g-dev libpopt-dev libsqlite0-dev liblua5.4-dev fakechroot libarchive-dev
- name: Setup | Checkout rpm
uses: actions/checkout@v2
with:
repository: rpm-software-management/rpm.git
ref: rpm-4.18.x
fetch-depth: 1
path: rpm-pristine
- name: Setup | Build Cache rpm
uses: actions/cache@v3
with:
path: |
rpm/
rpm-build/
key: ${{ runner.os }}-rpm-${{ hashFiles('rpm-pristine/.git/HEAD', 'rpm-pristine/.git/refs/heads/master') }}
- name: Test | rpm
run: |
export PKG_CONFIG_PATH=$(pwd)/target/debug
if ! test -e $PKG_CONFIG_PATH/rpm-sequoia-uninstalled.pc
then
echo "$PKG_CONFIG_PATH/rpm-sequoia-uninstalled.pc is missing. Did you build librpm-sequoia?"
exit 1
fi
export LD_LIBRARY_PATH=$PKG_CONFIG_PATH
if ! test -e $LD_LIBRARY_PATH/librpm_sequoia.so
then
echo "$LD_LIBRARY_PATH/librpm_sequoia.so is missing. Did you build librpm-sequoia?"
exit 1
fi
echo "::group::configure"
# If rpm doesn't exist, then we don't have a cache of an
# rpm build.
if ! test -e rpm
then
cp -a rpm-pristine rpm
cd rpm
autoreconf -is
cd ..
mkdir -p rpm-build
cd rpm-build
../rpm/configure --prefix=/ --with-crypto=sequoia
else
cd rpm-build
fi
echo "::endgroup::"
echo "::group::make"
make
echo "::endgroup::"
echo "::group::make check"
cd tests
if ! make check TESTSUITEFLAGS="-k OpenPGP -k signature -k rpmkeys -k digest"
then
echo "::endgroup::"
for log in rpmtests.dir/*/rpmtests.log
do
echo "::group::$log"
cat $log || true
echo "::endgroup::"
done
exit 1
else
echo "::endgroup::"
fi