-
Notifications
You must be signed in to change notification settings - Fork 0
84 lines (69 loc) · 1.75 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
name: CI
on:
push:
branches:
- master
pull_request:
branches:
- master
schedule:
- cron: "0 0 * * *"
jobs:
tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- id: install
run: |
rustup override set stable
rustup update stable
- name: restore build & cargo cache
uses: Swatinem/rust-cache@v2
- name: run tests
run: cargo test
fmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- id: install
run: |
rustup override set stable
rustup update stable
rustup component add rustfmt
- run: cargo fmt -- --check
clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- id: install
run: |
rustup override set stable
rustup update stable
rustup component add clippy
- name: restore build & cargo cache
uses: Swatinem/rust-cache@v2
- run: cargo clippy --workspace --locked -- -D warnings
docker:
runs-on: ubuntu-latest
env:
# Heroku doesn't support docker buildkit, so we have to ensure
# that the build works without it.
DOCKER_BUILDKIT: 0
steps:
- uses: actions/checkout@v4
- name: build docker image via docker-compose
run: docker compose build web
- name: start webserver
run: docker compose up web --wait
- name: test HTTP request
run: |
sudo apt-get install -y curl
curl \
--fail \
--show-error \
--connect-timeout 10 \
http://localhost:8000/ht
- name: stop webserver
run: docker compose down