1
- use std:: fs;
2
- use std:: path:: Path ;
3
-
1
+ use gh_actions_gen:: actions:: cargo_cache;
2
+ use gh_actions_gen:: actions:: cargo_doc;
4
3
use gh_actions_gen:: actions:: cargo_test;
5
4
use gh_actions_gen:: actions:: checkout_sources;
6
5
use gh_actions_gen:: actions:: rust_install_toolchain;
7
6
use gh_actions_gen:: actions:: RustToolchain ;
8
- use gh_actions_gen:: actions:: { cargo_cache, cargo_doc} ;
9
7
use gh_actions_gen:: ghwf:: Env ;
10
8
use gh_actions_gen:: ghwf:: Job ;
11
9
use gh_actions_gen:: ghwf:: Step ;
@@ -43,6 +41,10 @@ fn install_protobuf_step() -> Step {
43
41
Step :: run ( "install protobuf" , "./ci/install-protobuf.sh" )
44
42
}
45
43
44
+ fn protobuf_version_env ( ) -> ( String , String ) {
45
+ ( "PROTOBUF_VERSION" . to_owned ( ) , "3.1.0" . to_owned ( ) )
46
+ }
47
+
46
48
fn cargo_doc_job ( ) -> Job {
47
49
let os = LINUX ;
48
50
let mut steps = Vec :: new ( ) ;
@@ -54,7 +56,7 @@ fn cargo_doc_job() -> Job {
54
56
id : "cargo-doc" . to_owned ( ) ,
55
57
name : "cargo doc" . to_owned ( ) ,
56
58
runs_on : os. ghwf ,
57
- env : vec ! [ ( "PROTOBUF_VERSION" . to_owned ( ) , "3.1.0" . to_owned ( ) ) ] ,
59
+ env : vec ! [ protobuf_version_env ( ) ] ,
58
60
steps,
59
61
..Default :: default ( )
60
62
}
@@ -69,7 +71,10 @@ fn test_protoc_plugin_job() -> Job {
69
71
Job {
70
72
id : "test-protoc-plugin" . to_owned ( ) ,
71
73
name : "test-protoc-plugin" . to_owned ( ) ,
72
- env : vec ! [ ( "ACTION" . to_owned( ) , "test-protoc-plugin" . to_owned( ) ) ] ,
74
+ env : vec ! [
75
+ ( "ACTION" . to_owned( ) , "test-protoc-plugin" . to_owned( ) ) ,
76
+ protobuf_version_env( ) ,
77
+ ] ,
73
78
steps,
74
79
..Default :: default ( )
75
80
}
0 commit comments