Skip to content

Commit 77cc943

Browse files
committed
fix ci maybe
1 parent c1d27c8 commit 77cc943

File tree

5 files changed

+41
-92
lines changed

5 files changed

+41
-92
lines changed

.github/workflows/ci-master.yml renamed to .github/workflows/ci-post-merge.yml

Lines changed: 15 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: CI (master only)
1+
name: CI (post-merge)
22

33
on:
44
push:
@@ -65,10 +65,7 @@ jobs:
6565
# uses: Swatinem/[email protected]
6666

6767
- name: Install cargo-hack
68-
uses: actions-rs/cargo@v1
69-
with:
70-
command: install
71-
args: cargo-hack
68+
uses: taiki-e/install-action@cargo-hack
7269

7370
- name: check lib
7471
if: >
@@ -118,16 +115,10 @@ jobs:
118115
steps:
119116
- uses: actions/checkout@v2
120117

121-
- name: Install Rust (nightly)
122-
uses: actions-rs/toolchain@v1
123-
with:
124-
toolchain: nightly
125-
profile: minimal
126-
override: true
118+
- uses: dtolnay/rust-toolchain@nightly
127119

128120
- name: Generate Cargo.lock
129-
uses: actions-rs/cargo@v1
130-
with: { command: generate-lockfile }
121+
run: cargo generate-lockfile
131122
- name: Cache Dependencies
132123
uses: Swatinem/[email protected]
133124

@@ -147,64 +138,37 @@ jobs:
147138
steps:
148139
- uses: actions/checkout@v2
149140

150-
- name: Install Rust (nightly)
151-
uses: actions-rs/toolchain@v1
152-
with:
153-
toolchain: nightly
154-
profile: minimal
155-
override: true
141+
- uses: dtolnay/rust-toolchain@nightly
156142

157143
- name: Generate Cargo.lock
158-
uses: actions-rs/cargo@v1
159-
with: { command: generate-lockfile }
144+
run: cargo generate-lockfile
160145
- name: Cache Dependencies
161146
uses: Swatinem/[email protected]
162147

163148
- name: Install cargo-minimal-versions
164-
uses: actions-rs/cargo@v1
165-
with:
166-
command: install
167-
args: cargo-minimal-versions
149+
uses: taiki-e/install-action@cargo-minimal-versions
168150

169151
- name: Install cargo-hack
170-
uses: actions-rs/cargo@v1
171-
with:
172-
command: install
173-
args: cargo-hack
152+
uses: taiki-e/install-action@cargo-hack
174153

175154
- name: Check With Minimal Versions
176-
uses: actions-rs/cargo@v1
177-
with:
178-
command: minimal-versions
179-
args: check
155+
run: cargo minimal-versions check
180156

181157
nextest:
182158
name: nextest
183159
runs-on: ubuntu-latest
184160
steps:
185161
- uses: actions/checkout@v2
186162

187-
- name: Install Rust
188-
uses: actions-rs/toolchain@v1
189-
with:
190-
toolchain: stable
191-
profile: minimal
192-
override: true
163+
- uses: dtolnay/rust-toolchain@stable
164+
165+
- name: Install nextest
166+
uses: taiki-e/install-action@nextest
193167

194168
- name: Generate Cargo.lock
195-
uses: actions-rs/cargo@v1
196-
with: { command: generate-lockfile }
169+
run: cargo generate-lockfile
197170
- name: Cache Dependencies
198171
uses: Swatinem/[email protected]
199172

200-
- name: Install cargo-nextest
201-
uses: actions-rs/cargo@v1
202-
with:
203-
command: install
204-
args: cargo-nextest
205-
206173
- name: Test with cargo-nextest
207-
uses: actions-rs/cargo@v1
208-
with:
209-
command: nextest
210-
args: run
174+
run: cargo nextest run

.github/workflows/ci.yml

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,13 @@ jobs:
6868
# uses: Swatinem/[email protected]
6969

7070
- name: Install cargo-hack
71-
uses: actions-rs/cargo@v1
72-
with:
73-
command: install
74-
args: cargo-hack
71+
uses: taiki-e/install-action@cargo-hack
72+
73+
- name: workaround MSRV issues
74+
if: matrix.version != 'stable'
75+
run: |
76+
cargo install cargo-edit --version=0.8.0
77+
cargo add [email protected] --dev -p=actix-proxy-protocol
7578
7679
- name: Generate Cargo.lock
7780
uses: actions-rs/cargo@v1
@@ -131,20 +134,13 @@ jobs:
131134
rustdoc:
132135
name: rustdoc
133136
runs-on: ubuntu-latest
134-
135137
steps:
136138
- uses: actions/checkout@v2
137139

138-
- name: Install Rust (nightly)
139-
uses: actions-rs/toolchain@v1
140-
with:
141-
toolchain: nightly-x86_64-unknown-linux-gnu
142-
profile: minimal
143-
override: true
140+
- uses: dtolnay/rust-toolchain@nightly
144141

145142
- name: Generate Cargo.lock
146-
uses: actions-rs/cargo@v1
147-
with: { command: generate-lockfile }
143+
run: cargo generate-lockfile
148144
- name: Cache Dependencies
149145
uses: Swatinem/[email protected]
150146

.github/workflows/clippy-fmt.yml

Lines changed: 7 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -9,34 +9,20 @@ jobs:
99
runs-on: ubuntu-latest
1010
steps:
1111
- uses: actions/checkout@v2
12-
13-
- name: Install Rust
14-
uses: actions-rs/toolchain@v1
15-
with:
16-
toolchain: stable
17-
profile: minimal
18-
components: rustfmt
19-
override: true
20-
- name: Rustfmt Check
21-
uses: actions-rs/cargo@v1
22-
with:
23-
command: fmt
24-
args: --all -- --check
12+
- uses: dtolnay/rust-toolchain@nightly
13+
with: { components: rustfmt }
14+
- run: cargo fmt --all -- --check
2515

2616
clippy:
2717
runs-on: ubuntu-latest
2818
steps:
2919
- uses: actions/checkout@v2
3020

31-
- name: Install Rust
32-
uses: actions-rs/toolchain@v1
33-
with:
34-
toolchain: stable
35-
profile: minimal
36-
components: clippy
37-
override: true
21+
- uses: dtolnay/rust-toolchain@stable
22+
with: { components: clippy }
23+
3824
- name: Clippy Check
3925
uses: actions-rs/clippy-check@v1
4026
with:
27+
args: --workspace --all-features --tests --examples --bins -- -Dwarnings -Dclippy::todo
4128
token: ${{ secrets.GITHUB_TOKEN }}
42-
args: --workspace --all-features --tests --examples --bins -- -Dclippy::todo

.github/workflows/upload-doc.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@ jobs:
2828
run: echo '<meta http-equiv="refresh" content="0;url=actix_server/index.html">' > target/doc/index.html
2929

3030
- name: Deploy to GitHub Pages
31-
uses: JamesIves/github-pages-deploy-action@3.7.1
31+
uses: JamesIves/github-pages-deploy-action@v4.4.1
3232
with:
33-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34-
BRANCH: gh-pages
35-
FOLDER: target/doc
33+
folder: target/doc
34+
single-commit: true

actix-proxy-protocol/src/tlv.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use std::{borrow::Cow, convert::TryFrom, str};
22

3-
const PP2_TYPE_ALPN: u8 = 0x01;
4-
const PP2_TYPE_AUTHORITY: u8 = 0x02;
3+
const PP2_TYPE_ALPN: u8 = 0x01; // done
4+
const PP2_TYPE_AUTHORITY: u8 = 0x02; // done
55
const PP2_TYPE_CRC32C: u8 = 0x03; // done
66
const PP2_TYPE_NOOP: u8 = 0x04; // done
77
const PP2_TYPE_UNIQUE_ID: u8 = 0x05; // done
@@ -178,11 +178,15 @@ impl UniqueId {
178178
///
179179
///
180180
/// # Panics
181-
/// Panics if `value` is empty (i.e., has length of 0).
181+
/// Panics if `value` is 0 bytes or larger than 128 bytes.
182182
pub fn new(id: impl Into<Vec<u8>>) -> Self {
183183
let value = id.into();
184184

185185
assert!(!value.is_empty(), "UniqueId TLV `value` cannot be empty");
186+
assert!(
187+
value.len() < 128,
188+
"UniqueId TLV `value` cannot be larger than 128 bytes"
189+
);
186190

187191
Self { value }
188192
}

0 commit comments

Comments
 (0)