File tree Expand file tree Collapse file tree 3 files changed +54
-2
lines changed Expand file tree Collapse file tree 3 files changed +54
-2
lines changed Original file line number Diff line number Diff line change 4
4
push :
5
5
paths :
6
6
- .github/workflows/check.yaml
7
+ - crates/**
7
8
- frontend/**
9
+ - Cargo.lock
8
10
9
11
jobs :
10
- check :
12
+ check-frontend :
11
13
runs-on : ubuntu-latest
12
14
steps :
13
15
- uses : actions/checkout@v4
23
25
24
26
- name : check format
25
27
run : cd frontend && yarn format:check
28
+
29
+ check-rust :
30
+ runs-on : ubuntu-latest
31
+ env :
32
+ SERVER_HOST : http://localhost
33
+ SERVER_PORT : " 3000"
34
+ DB_PATH : db.redb
35
+ WEB_ORIGIN : http://localhost:8080
36
+
37
+ steps :
38
+ - uses : actions/checkout@v4
39
+
40
+ - uses : actions-rust-lang/setup-rust-toolchain@v1
41
+ with :
42
+ components : clippy,rustfmt
43
+ - uses : Swatinem/rust-cache@v2
44
+
45
+ - uses : DeterminateSystems/nix-installer-action@main
46
+ - uses : DeterminateSystems/magic-nix-cache-action@main
47
+
48
+ - name : install tools
49
+ run : |
50
+ nix profile add "nixpkgs#just" && just -V
51
+ nix profile add "nixpkgs#cargo-nextest" && cargo nextest -V
52
+
53
+ - name : check
54
+ run : |
55
+ touch .env
56
+ just check
57
+
58
+ - name : test
59
+ run : just test
Original file line number Diff line number Diff line change
1
+ use std:: path:: PathBuf ;
2
+
1
3
fn main ( ) {
2
- println ! ( "cargo::rerun-if-changed=../../.env" ) ;
4
+ let envs = [ "SERVER_HOST" , "SERVER_PORT" , "DB_PATH" , "WEB_ORIGIN" ] ;
5
+ if PathBuf :: from ( "../../.env" ) . exists ( ) {
6
+ println ! ( "cargo::rerun-if-changed=../../.env" ) ;
7
+ }
8
+ for env in envs {
9
+ println ! ( "cargo::rerun-if-env-changed={env}" ) ;
10
+ if let Ok ( value) = std:: env:: var ( env) {
11
+ println ! ( "cargo::rustc-env={env}={value}" ) ;
12
+ }
13
+ }
3
14
}
Original file line number Diff line number Diff line change 1
1
use std:: path:: PathBuf ;
2
2
3
3
fn main ( ) {
4
+ let envs = [ "SERVER_HOST" , "SERVER_PORT" , "DB_PATH" , "WEB_ORIGIN" ] ;
4
5
if PathBuf :: from ( "../../.env" ) . exists ( ) {
5
6
println ! ( "cargo::rerun-if-changed=../../.env" ) ;
6
7
}
8
+ for env in envs {
9
+ println ! ( "cargo::rerun-if-env-changed={env}" ) ;
10
+ if let Ok ( value) = std:: env:: var ( env) {
11
+ println ! ( "cargo::rustc-env={env}={value}" ) ;
12
+ }
13
+ }
7
14
}
You can’t perform that action at this time.
0 commit comments