-
Notifications
You must be signed in to change notification settings - Fork 6
45 lines (42 loc) · 1.51 KB
/
rust.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
name: Rust
on:
pull_request:
branches: [main, "renovate/*"]
push:
branches: ["renovate/*"]
env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Mock an env file
run: |
echo "DATABASE_URL=test_url" >> backend/.env
echo "JWT_SECRET=test_secret" >> backend/.env
echo "GOOGLE_CLIENT_ID=test" >> backend/.env
echo "GOOGLE_CLIENT_SECRET=test" >> backend/.env
echo "GOOGLE_REDIRECT_URI=http://localhost:3000/auth/callback" >> backend/.env
echo "ROCKET_DATABASES='{}'" >> backend/.env
# selecting a toolchain either by action or manual `rustup` calls should happen
# before the plugin, as it uses the current rustc version as its cache key
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
- uses: Swatinem/rust-cache@v2
with:
working-directory: backend/
- name: Build
run: cargo build --manifest-path backend/server/Cargo.toml
- name: Cargo Clippy
run: cargo clippy --manifest-path backend/server/Cargo.toml
- name: RustFmt
run: cargo fmt --manifest-path backend/server/Cargo.toml
- name: Build
run: cargo build --manifest-path backend/seed_data/Cargo.toml
- name: Cargo Clippy
run: cargo clippy --manifest-path backend/seed_data/Cargo.toml
- name: RustFmt
run: cargo fmt --manifest-path backend/seed_data/Cargo.toml