forked from rpm-software-management/rpm-sequoia
-
Notifications
You must be signed in to change notification settings - Fork 0
162 lines (139 loc) · 4.71 KB
/
ci.yml
File metadata and controls
162 lines (139 loc) · 4.71 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
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
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@v4
- 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@v4
with:
fetch-depth: 0
- name: Setup | Build Cache rpm-sequoia
uses: actions/cache@v4
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@v4
with:
fetch-depth: 0
- name: Setup | Build Cache rpm-sequoia
uses: actions/cache@v4
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@v4
with:
fetch-depth: 0
- name: Setup | Build Cache Rust dependencies
uses: actions/cache@v4
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 podman
- name: Setup | Checkout rpm
uses: actions/checkout@v4
with:
repository: rpm-software-management/rpm.git
ref: master
fetch-depth: 1
path: rpm
- 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::make check"
cd rpm
RPM_ROOT=$(pwd)
cd tests
# based on ./mktree.oci build
podman build --target full -t rpm-tests -f Dockerfile ..
# install rpm-sequoia in the test image
podman build -t rpm-tests-sequoia -f ../../tests/Dockerfile ../../
# run the tests by overriding librpm-sequoia in the container.
if ! podman run --privileged -it --rm --read-only --tmpfs /tmp -v $RPM_ROOT:/srv:z \
--workdir /srv -e ROOTLESS=1 rpm-tests-sequoia \
rpmtests -k OpenPGP -k signature -k rpmkeys -k digest;
then
echo "::endgroup::"
cd ..
for log in rpmtests.dir/*/rpmtests.log
do
echo "::group::$log"
cat $log || true
echo "::endgroup::"
done
exit 1
else
echo "::endgroup::"
fi