Skip to content

Commit a0c462b

Browse files
committed
Adds unit tests
1 parent f97861e commit a0c462b

File tree

4 files changed

+398
-29
lines changed

4 files changed

+398
-29
lines changed

.gitlab-ci.yml

Lines changed: 33 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,25 @@ variables:
1515
PACKAGE_PATH_ARM64: rockpass-${CI_COMMIT_TAG}-linux-arm64
1616

1717
stages:
18+
- Test
1819
- Build
20+
- Archive
1921
- Package
2022
- Docker
2123
- Publish
2224
- Release
2325

24-
Build Rockpass AMD64 glibc:
26+
Test AMD64 glibc:
27+
stage: Test
28+
image: rust:buster
29+
script:
30+
- cargo test
31+
cache:
32+
key: ${CI_COMMIT_REF_SLUG}-amd64-glibc
33+
paths:
34+
- target
35+
36+
Build AMD64 glibc:
2537
stage: Build
2638
image: rust:buster
2739
script:
@@ -35,7 +47,7 @@ Build Rockpass AMD64 glibc:
3547
paths:
3648
- target
3749

38-
Build Rockpass AMD64 musl:
50+
Build AMD64 musl:
3951
stage: Build
4052
image: rust:alpine
4153
script:
@@ -50,7 +62,7 @@ Build Rockpass AMD64 musl:
5062
paths:
5163
- target
5264

53-
Build Rockpass ARM64:
65+
Build ARM64:
5466
stage: Build
5567
image: rust:alpine
5668
script:
@@ -67,8 +79,8 @@ Build Rockpass ARM64:
6779
tags:
6880
- arm64
6981

70-
Package Rockpass AMD64 glibc:
71-
stage: Package
82+
Archive AMD64 glibc:
83+
stage: Archive
7284
script:
7385
- install -Dm755 "target/release/rockpass" "${ARTIFACTS_AMD64_GLIBC}/rockpass"
7486
- install -Dm644 "rockpass.toml.example" "${ARTIFACTS_AMD64_GLIBC}/rockpass.toml.example"
@@ -79,12 +91,12 @@ Package Rockpass AMD64 glibc:
7991
paths:
8092
- ${ARTIFACTS_AMD64_GLIBC}/
8193
needs:
82-
- Build Rockpass AMD64 glibc
94+
- Build AMD64 glibc
8395
rules:
8496
- if: $CI_COMMIT_TAG == null && $CI_PIPELINE_SOURCE != "merge_request_event"
8597

86-
Package Rockpass AMD64 musl:
87-
stage: Package
98+
Archive AMD64 musl:
99+
stage: Archive
88100
script:
89101
- install -Dm755 "target/release/rockpass" "${ARTIFACTS_AMD64_MUSL}/rockpass"
90102
- install -Dm644 "rockpass.toml.example" "${ARTIFACTS_AMD64_MUSL}/rockpass.toml.example"
@@ -95,12 +107,12 @@ Package Rockpass AMD64 musl:
95107
paths:
96108
- ${ARTIFACTS_AMD64_MUSL}/
97109
needs:
98-
- Build Rockpass AMD64 musl
110+
- Build AMD64 musl
99111
rules:
100112
- if: $CI_COMMIT_TAG == null && $CI_PIPELINE_SOURCE != "merge_request_event"
101113

102-
Package Rockpass ARM64:
103-
stage: Package
114+
Archive ARM64:
115+
stage: Archive
104116
script:
105117
- install -Dm755 "target/release/rockpass" "${ARTIFACTS_ARM64}/rockpass"
106118
- install -Dm644 "rockpass.toml.example" "${ARTIFACTS_ARM64}/rockpass.toml.example"
@@ -111,11 +123,11 @@ Package Rockpass ARM64:
111123
paths:
112124
- ${ARTIFACTS_ARM64}/
113125
needs:
114-
- Build Rockpass ARM64
126+
- Build ARM64
115127
rules:
116128
- if: $CI_COMMIT_TAG == null && $CI_PIPELINE_SOURCE != "merge_request_event"
117129

118-
Package Rockpass release AMD64 glibc:
130+
Package AMD64 glibc:
119131
stage: Package
120132
script:
121133
- apk -U --no-progress add xz
@@ -129,11 +141,11 @@ Package Rockpass release AMD64 glibc:
129141
paths:
130142
- ${PACKAGE_NAME_AMD64_GLIBC}
131143
needs:
132-
- Build Rockpass AMD64 glibc
144+
- Build AMD64 glibc
133145
rules:
134146
- if: $CI_COMMIT_TAG && $CI_PROJECT_ID == "43241571"
135147

136-
Package Rockpass release AMD64 musl:
148+
Package AMD64 musl:
137149
stage: Package
138150
script:
139151
- apk -U --no-progress add xz
@@ -147,11 +159,11 @@ Package Rockpass release AMD64 musl:
147159
paths:
148160
- ${PACKAGE_NAME_AMD64_MUSL}
149161
needs:
150-
- Build Rockpass AMD64 musl
162+
- Build AMD64 musl
151163
rules:
152164
- if: $CI_COMMIT_TAG && $CI_PROJECT_ID == "43241571"
153165

154-
Package Rockpass release ARM64:
166+
Package ARM64:
155167
stage: Package
156168
script:
157169
- apk -U --no-progress add xz
@@ -165,7 +177,7 @@ Package Rockpass release ARM64:
165177
paths:
166178
- ${PACKAGE_NAME_ARM64}
167179
needs:
168-
- Build Rockpass ARM64
180+
- Build ARM64
169181
rules:
170182
- if: $CI_COMMIT_TAG && $CI_PROJECT_ID == "43241571"
171183

@@ -187,7 +199,7 @@ Build and publish branch Docker image:
187199
rules:
188200
- if: $CI_COMMIT_TAG == null && $CI_PROJECT_ID == "43241571" && $CI_PIPELINE_SOURCE != "merge_request_event" && $CI_COMMIT_REF_PROTECTED == "true"
189201
needs:
190-
- Build Rockpass AMD64 musl
202+
- Build AMD64 musl
191203

192204
Build and publish release Docker image:
193205
stage: Docker
@@ -232,9 +244,9 @@ Build and publish release Docker image:
232244
rules:
233245
- if: $CI_COMMIT_TAG && $CI_PROJECT_ID == "43241571"
234246
needs:
235-
- Build Rockpass AMD64 musl
247+
- Build AMD64 musl
236248

237-
Publish Rockpass release:
249+
Publish release:
238250
stage: Publish
239251
image: curlimages/curl:latest
240252
script:

README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,10 @@ sudo systemctl start rockpass
2323
sudo systemctl enable rockpass
2424
```
2525

26-
Warning: The only binary provided is for `linux-amd64`, if you need to run
27-
Rockpass on another architecture (like a Raspberry Pi) you must compile it,
28-
see how to do it in the [from source section](#from-source).
26+
Warning: The only binaries provided are for `linux-amd64` and `linux-arm64`,
27+
if you need to run Rockpass on another architecture (like a Raspberry Pi
28+
32bit) you must compile it, see how to do it in the [from source
29+
section](#from-source).
2930

3031
Note that the systemd unit uses a dynamic user that has a persistent
3132
directory in `/var/lib/rockpass/` so it is recommended that the SQLite DB be
@@ -43,7 +44,7 @@ learn how to create your first user.
4344
### With Docker
4445

4546
You can download a Rockpass Docker image from [here][glcr], from [Docker
46-
Hub][hub] or from [Quay][quay].
47+
Hub][hub] or from [Quay][quay] (only `linux-amd64-musl`).
4748

4849
To run it, simply exec.
4950
```
@@ -112,7 +113,7 @@ rustup override set stable
112113

113114
[rustup]: https://rustup.rs/
114115

115-
#### Installing Rockpass
116+
#### Building Rockpass
116117

117118
To build Rockpass binary simply execute the following commands.
118119
```shell

0 commit comments

Comments
 (0)