Repository navigation
51 lines (46 loc) · 1.56 KB
/
Copy pathci.yml
File metadata and controls
51 lines (46 loc) · 1.56 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
name: CI
on:
push:
branches: [main]
pull_request:
# Read-only token: CI only checks out and tests, and pull requests from forks
# must not get write access.
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
server:
name: Rust
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
submodules: true
- uses: dtolnay/rust-toolchain@b725eda525362e7cf34af9a7243cac1e3f01a7ec # stable
with:
components: rustfmt, clippy
- uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3
- run: cargo fmt --all -- --check
- run: cargo clippy --workspace --all-targets -- -D warnings
- run: cargo test --workspace
docker:
name: Docker image
runs-on: ubuntu-latest
needs: [server]
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
submodules: true
- run: docker build -t obn-server:ci --build-arg OBN_BUILD_SHA=${{ github.sha }} .
- name: Smoke test
run: |
docker run -d --name obn -p 18080:8080 obn-server:ci
for i in $(seq 1 30); do
curl -fsS localhost:18080/healthz >/dev/null 2>&1 && break
if [ "$i" -eq 30 ]; then docker logs obn; echo "server did not become healthy"; exit 1; fi
sleep 1
done
test "$(curl -fsS localhost:18080/v0/stats)" = '{"apps":[]}'
docker stop obn