Skip to content

Commit b2b1349

Browse files
committed
Use yaml-rust library to generate Yaml
1 parent 9072b3d commit b2b1349

File tree

5 files changed

+180
-213
lines changed

5 files changed

+180
-213
lines changed

.github/workflows/ci.yml

Lines changed: 145 additions & 144 deletions
Original file line numberDiff line numberDiff line change
@@ -1,148 +1,149 @@
11
# @generated by ci-gen, do not edit
22

3-
on:
4-
- push
5-
- pull_request
3+
---
4+
"on":
5+
- push
6+
- pull_request
67
name: Jobs
78
jobs:
8-
linux-stable:
9-
name: linux stable
10-
runs-on: ubuntu-latest
11-
steps:
12-
- name: Checkout sources
13-
uses: actions/checkout@v2
14-
- name: Install toolchain
15-
uses: actions-rs/toolchain@v1
16-
with:
17-
profile: minimal
18-
toolchain: stable
19-
override: true
20-
- name: cargo test
21-
uses: actions-rs/cargo@v1
22-
with:
23-
command: test
24-
args: --all --all-targets -- --test-threads=1
25-
timeout-minutes: 10
26-
- name: cargo test --doc
27-
uses: actions-rs/cargo@v1
28-
with:
29-
command: test
30-
args: --doc
31-
- name: doc
32-
uses: actions-rs/cargo@v1
33-
with:
34-
command: doc
35-
macos-stable:
36-
name: macos stable
37-
runs-on: macos-latest
38-
steps:
39-
- name: Checkout sources
40-
uses: actions/checkout@v2
41-
- name: Install toolchain
42-
uses: actions-rs/toolchain@v1
43-
with:
44-
profile: minimal
45-
toolchain: stable
46-
override: true
47-
- name: cargo test
48-
uses: actions-rs/cargo@v1
49-
with:
50-
command: test
51-
args: --all --all-targets -- --test-threads=1
52-
timeout-minutes: 10
53-
- name: cargo test --doc
54-
uses: actions-rs/cargo@v1
55-
with:
56-
command: test
57-
args: --doc
58-
windows-stable:
59-
name: windows stable
60-
runs-on: windows-latest
61-
env:
62-
VCPKGRS_DYNAMIC: 1
63-
steps:
64-
- name: Checkout sources
65-
uses: actions/checkout@v2
66-
- name: Install toolchain
67-
uses: actions-rs/toolchain@v1
68-
with:
69-
profile: minimal
70-
toolchain: stable
71-
override: true
72-
- name: cargo build main crate only
73-
uses: actions-rs/cargo@v1
74-
with:
75-
command: build
76-
args: -p httpbis
77-
linux-beta:
78-
name: linux beta
79-
runs-on: ubuntu-latest
80-
steps:
81-
- name: Checkout sources
82-
uses: actions/checkout@v2
83-
- name: Install toolchain
84-
uses: actions-rs/toolchain@v1
85-
with:
86-
profile: minimal
87-
toolchain: beta
88-
override: true
89-
- name: cargo test
90-
uses: actions-rs/cargo@v1
91-
with:
92-
command: test
93-
args: --all --all-targets -- --test-threads=1
94-
timeout-minutes: 10
95-
- name: cargo test --doc
96-
uses: actions-rs/cargo@v1
97-
with:
98-
command: test
99-
args: --doc
100-
- name: doc
101-
uses: actions-rs/cargo@v1
102-
with:
103-
command: doc
104-
linux-nightly:
105-
name: linux nightly
106-
runs-on: ubuntu-latest
107-
steps:
108-
- name: Checkout sources
109-
uses: actions/checkout@v2
110-
- name: Install toolchain
111-
uses: actions-rs/toolchain@v1
112-
with:
113-
profile: minimal
114-
toolchain: nightly
115-
override: true
116-
- name: cargo test
117-
uses: actions-rs/cargo@v1
118-
with:
119-
command: test
120-
args: --all --all-targets -- --test-threads=1
121-
timeout-minutes: 10
122-
- name: cargo test --doc
123-
uses: actions-rs/cargo@v1
124-
with:
125-
command: test
126-
args: --doc
127-
- name: doc
128-
uses: actions-rs/cargo@v1
129-
with:
130-
command: doc
131-
h2spec:
132-
name: h2spec
133-
runs-on: ubuntu-latest
134-
steps:
135-
- name: Checkout sources
136-
uses: actions/checkout@v2
137-
- name: Install h2spec
138-
run: ci/install-h2spec.sh
139-
shell: bash
140-
- name: Build h2spec test
141-
uses: actions-rs/cargo@v1
142-
with:
143-
command: build
144-
args: --manifest-path h2spec-test/Cargo.toml --bin the_test
145-
- name: Run h2spec test
146-
run: PATH="$(pwd):$PATH" cargo run --manifest-path h2spec-test/Cargo.toml --bin the_test
147-
shell: bash
148-
timeout-minutes: 5
9+
linux-stable:
10+
name: linux stable
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout sources
14+
uses: actions/checkout@v2
15+
- name: Install toolchain
16+
uses: actions-rs/toolchain@v1
17+
with:
18+
profile: minimal
19+
toolchain: stable
20+
override: true
21+
- name: cargo test
22+
uses: actions-rs/cargo@v1
23+
with:
24+
command: test
25+
args: "--all --all-targets -- --test-threads=1"
26+
timeout-minutes: 10
27+
- name: cargo test --doc
28+
uses: actions-rs/cargo@v1
29+
with:
30+
command: test
31+
args: "--doc"
32+
- name: doc
33+
uses: actions-rs/cargo@v1
34+
with:
35+
command: doc
36+
macos-stable:
37+
name: macos stable
38+
runs-on: macos-latest
39+
steps:
40+
- name: Checkout sources
41+
uses: actions/checkout@v2
42+
- name: Install toolchain
43+
uses: actions-rs/toolchain@v1
44+
with:
45+
profile: minimal
46+
toolchain: stable
47+
override: true
48+
- name: cargo test
49+
uses: actions-rs/cargo@v1
50+
with:
51+
command: test
52+
args: "--all --all-targets -- --test-threads=1"
53+
timeout-minutes: 10
54+
- name: cargo test --doc
55+
uses: actions-rs/cargo@v1
56+
with:
57+
command: test
58+
args: "--doc"
59+
windows-stable:
60+
name: windows stable
61+
runs-on: windows-latest
62+
env:
63+
VCPKGRS_DYNAMIC: "1"
64+
steps:
65+
- name: Checkout sources
66+
uses: actions/checkout@v2
67+
- name: Install toolchain
68+
uses: actions-rs/toolchain@v1
69+
with:
70+
profile: minimal
71+
toolchain: stable
72+
override: true
73+
- name: cargo build main crate only
74+
uses: actions-rs/cargo@v1
75+
with:
76+
command: build
77+
args: "-p httpbis"
78+
linux-beta:
79+
name: linux beta
80+
runs-on: ubuntu-latest
81+
steps:
82+
- name: Checkout sources
83+
uses: actions/checkout@v2
84+
- name: Install toolchain
85+
uses: actions-rs/toolchain@v1
86+
with:
87+
profile: minimal
88+
toolchain: beta
89+
override: true
90+
- name: cargo test
91+
uses: actions-rs/cargo@v1
92+
with:
93+
command: test
94+
args: "--all --all-targets -- --test-threads=1"
95+
timeout-minutes: 10
96+
- name: cargo test --doc
97+
uses: actions-rs/cargo@v1
98+
with:
99+
command: test
100+
args: "--doc"
101+
- name: doc
102+
uses: actions-rs/cargo@v1
103+
with:
104+
command: doc
105+
linux-nightly:
106+
name: linux nightly
107+
runs-on: ubuntu-latest
108+
steps:
109+
- name: Checkout sources
110+
uses: actions/checkout@v2
111+
- name: Install toolchain
112+
uses: actions-rs/toolchain@v1
113+
with:
114+
profile: minimal
115+
toolchain: nightly
116+
override: true
117+
- name: cargo test
118+
uses: actions-rs/cargo@v1
119+
with:
120+
command: test
121+
args: "--all --all-targets -- --test-threads=1"
122+
timeout-minutes: 10
123+
- name: cargo test --doc
124+
uses: actions-rs/cargo@v1
125+
with:
126+
command: test
127+
args: "--doc"
128+
- name: doc
129+
uses: actions-rs/cargo@v1
130+
with:
131+
command: doc
132+
h2spec:
133+
name: h2spec
134+
runs-on: ubuntu-latest
135+
steps:
136+
- name: Checkout sources
137+
uses: actions/checkout@v2
138+
- name: Install h2spec
139+
run: ci/install-h2spec.sh
140+
shell: bash
141+
- name: Build h2spec test
142+
uses: actions-rs/cargo@v1
143+
with:
144+
command: build
145+
args: "--manifest-path h2spec-test/Cargo.toml --bin the_test"
146+
- name: Run h2spec test
147+
run: "PATH=\"$(pwd):$PATH\" cargo run --manifest-path h2spec-test/Cargo.toml --bin the_test"
148+
shell: bash
149+
timeout-minutes: 5

ci-gen/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ edition = "2018"
66
publish = false
77

88
[dependencies]
9+
yaml-rust = "=0.4.5"

ci-gen/src/actions.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ pub fn rust_install_toolchain(channel: RustToolchain) -> Step {
2828
"Install toolchain",
2929
"actions-rs/toolchain@v1",
3030
Yaml::map(vec![
31-
("profile", "minimal"),
32-
("toolchain", &format!("{}", channel)),
33-
("override", "true"),
31+
("profile", Yaml::from("minimal")),
32+
("toolchain", Yaml::from(format!("{}", channel))),
33+
("override", Yaml::from(true)),
3434
]),
3535
)
3636
}

ci-gen/src/ghwf.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ impl Into<Yaml> for Step {
121121
entries.push(("env", Yaml::map(env)));
122122
}
123123
if let Some(timeout_minutes) = timeout_minutes {
124-
entries.push(("timeout-minutes", Yaml::String(timeout_minutes.to_string())));
124+
entries.push(("timeout-minutes", Yaml::Int(timeout_minutes as i64)));
125125
}
126126
Yaml::map(entries)
127127
}

0 commit comments

Comments
 (0)