Skip to content

Commit 5c04376

Browse files
committed
feat: implement async-ssh2-russh
From https://github.com/hydro-project/async-ssh2-russh
0 parents  commit 5c04376

22 files changed

+3518
-0
lines changed

.cargo/config.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[build]
2+
RUSTDOCFLAGS = "--cfg docsrs"

.github/workflows/ci.yml

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- feature/**
8+
pull_request:
9+
schedule:
10+
- cron: "35 03 * * *" # Daily at 8:35 PM PDT, 7:35 PM PST.
11+
workflow_dispatch:
12+
inputs:
13+
should_bench:
14+
description: "Should Benchmark? (`true`)"
15+
required: true
16+
default: "false"
17+
18+
jobs:
19+
pre_job:
20+
runs-on: ubuntu-latest
21+
outputs:
22+
should_skip: ${{ steps.skip_check.outputs.should_skip }}
23+
steps:
24+
- id: skip_check
25+
uses: fkirc/[email protected]
26+
with:
27+
cancel_others: "true"
28+
29+
fmt:
30+
name: Format Code
31+
if: ${{ needs.pre_job.outputs.should_skip != 'true' || github.event_name != 'pull_request' }}
32+
timeout-minutes: 10
33+
needs: pre_job
34+
runs-on: ubuntu-latest
35+
env:
36+
RUSTUP_TOOLCHAIN: nightly
37+
steps:
38+
- uses: actions/checkout@v4
39+
- run: cargo fmt --all -- --check
40+
41+
lints:
42+
name: Clippy and Check
43+
if: ${{ needs.pre_job.outputs.should_skip != 'true' || github.event_name != 'pull_request' }}
44+
timeout-minutes: 20
45+
needs: pre_job
46+
runs-on: ubuntu-latest
47+
steps:
48+
- uses: actions/checkout@v4
49+
- run: cargo clippy --all-targets --all-features -- -D warnings
50+
- run: cargo check --all-targets --all-features
51+
- run: cargo check --all-targets --no-default-features
52+
53+
test:
54+
name: Test
55+
if: ${{ needs.pre_job.outputs.should_skip != 'true' || github.event_name != 'pull_request' }}
56+
timeout-minutes: 10
57+
needs: pre_job
58+
runs-on: ubuntu-latest
59+
steps:
60+
- uses: actions/checkout@v4
61+
- run: cargo test --all-targets --no-fail-fast --all-features
62+
- run: cargo test --doc --no-fail-fast --all-features
63+
64+
miri:
65+
name: Miri
66+
if: ${{ needs.pre_job.outputs.should_skip != 'true' || github.event_name != 'pull_request' }}
67+
timeout-minutes: 10
68+
needs: pre_job
69+
runs-on: ubuntu-latest
70+
env:
71+
RUSTUP_TOOLCHAIN: nightly
72+
steps:
73+
- uses: actions/checkout@v4
74+
- run: rustup component add miri
75+
- run: cargo miri test --no-fail-fast --all-targets --all-features
76+
77+
doc:
78+
name: Docs
79+
needs: pre_job
80+
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
81+
runs-on: ubuntu-latest
82+
env:
83+
RUSTDOCFLAGS: -Dwarnings
84+
RUSTUP_TOOLCHAIN: nightly
85+
steps:
86+
- uses: actions/checkout@v4
87+
- uses: dtolnay/install@cargo-docs-rs
88+
- run: cargo docs-rs -p async-promise
89+
- run: cargo docs-rs -p async-ssh2-russh
90+
91+
msrv:
92+
name: Verify MSRV
93+
needs: pre_job
94+
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
95+
runs-on: ubuntu-latest
96+
steps:
97+
- uses: actions/checkout@v4
98+
- run: cargo install cargo-msrv --no-default-features
99+
- run: cargo msrv verify --path async-promise
100+
- run: cargo msrv verify --path async-ssh2-russh
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Conventional Commits
2+
3+
on:
4+
pull_request_target:
5+
types:
6+
- opened
7+
- edited
8+
- synchronize
9+
10+
permissions:
11+
pull-requests: read
12+
13+
jobs:
14+
main:
15+
name: Conventional Commits
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: amannn/action-semantic-pull-request@v5
19+
env:
20+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/release.yml

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
name: Release
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
bump:
7+
description: "Specify how to bump the version for Hydro crates. Does not affect dependencies."
8+
required: true
9+
default: "keep"
10+
type: choice
11+
options:
12+
- major
13+
- minor
14+
- patch
15+
- keep
16+
- auto
17+
execute:
18+
description: "Actually execute and publish the release?"
19+
required: true
20+
type: boolean
21+
default: false
22+
23+
jobs:
24+
release_job:
25+
name: Release Job
26+
timeout-minutes: 20
27+
runs-on: ubuntu-latest
28+
steps:
29+
# https://github.com/orgs/community/discussions/25305#discussioncomment-8256560
30+
# Unfortunately branch protection means that this workflow can't push the updated changelogs
31+
# and tags to `main` in the normal way. Instead we have an app:
32+
# https://github.com/organizations/hydro-project/settings/apps/hydro-project-bot
33+
# Which is added the the users allowed to bypass branch protections:
34+
# https://github.com/hydro-project/hydro/settings/branches
35+
# We grab a token from the app using this action via the `APP_ID` ("App ID") and an
36+
# `APP_PRIVATE_KEY` ("Generate a private key").
37+
- name: Generate token
38+
id: generate_token
39+
uses: actions/create-github-app-token@v1
40+
with:
41+
app-id: ${{ secrets.APP_ID }}
42+
private-key: ${{ secrets.APP_PRIVATE_KEY }}
43+
44+
- run: |
45+
echo "Version bump: $BUMP"
46+
echo "Execute: $EXECUTE"
47+
env:
48+
BUMP: ${{ inputs.bump }}
49+
EXECUTE: ${{ inputs.execute }}
50+
51+
# https://api.github.com/users/hydro-project-bot[bot]
52+
- name: Configure git
53+
run: |
54+
git config --global user.name "hydro-project-bot[bot]"
55+
git config --global user.email "132423234+hydro-project-bot[bot]@users.noreply.github.com"
56+
57+
- name: Checkout sources
58+
uses: actions/checkout@v4
59+
with:
60+
# Fetch all commit history so smart-release can generate changelogs.
61+
fetch-depth: 0
62+
token: ${{ steps.generate_token.outputs.token }}
63+
64+
- name: Run cargo login
65+
run: cargo login ${{ secrets.CARGO_REGISTRY_TOKEN }}
66+
67+
- name: Install cargo-smart-release
68+
run: cargo install cargo-smart-release
69+
70+
- name: Run cargo smart-release
71+
# list lockstep-versioned packages at the end of this command
72+
run: >-
73+
cargo smart-release --update-crates-index
74+
--no-changelog-preview --allow-fully-generated-changelogs
75+
--bump ${{ inputs.bump }} --bump-dependencies auto
76+
${{ inputs.execute && '--execute' || '--no-publish' }}
77+
async-promise async-ssh2-russh
78+
|& tee release.log
79+
env:
80+
# Make sure to set this so the `gh` CLI works using our token.
81+
GH_TOKEN: ${{ steps.generate_token.outputs.token }}
82+
83+
- name: Check release.log for changelog review
84+
run: |
85+
if grep "WOULD ask for review" release.log; then
86+
echo "Changelog review required. Please see the line above and check RELEASING.md for more details."
87+
exit 1
88+
fi

.gitignore

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/target
2+
/rust.git
3+
/*.dot
4+
__pycache__/
5+
**/.DS_Store
6+
**/target-bisector-*
7+
8+
# Profiling related outputs of the perf binary and cargo-flamegraph
9+
perf.data
10+
perf.data.old
11+
flamegraph.svg
12+
13+
/rustc-ice-*.txt
14+
/.hydro/
15+
/*.data.folded
16+
/*.perf.data
17+
/*.svg
18+
/*.profile
19+
20+
# Generated by release.yml
21+
/release.log

.vscode/settings.json

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"rust-analyzer.runnables.extraTestBinaryArgs": [
3+
"--nocapture"
4+
],
5+
"rust-analyzer.cargo.features": "all",
6+
"rust-analyzer.check.features": "all",
7+
"editor.semanticTokenColorCustomizations": {
8+
"enabled": true,
9+
"rules": {
10+
"*.unsafe:rust": {
11+
"foreground": "#ea1708",
12+
"fontStyle": "bold"
13+
}
14+
}
15+
},
16+
"files.watcherExclude": {
17+
"**/target": true
18+
},
19+
"evenBetterToml.formatter.columnWidth": 80,
20+
"evenBetterToml.formatter.compactArrays": true,
21+
"evenBetterToml.formatter.allowedBlankLines": 2,
22+
"evenBetterToml.formatter.trailingNewline": true,
23+
"evenBetterToml.formatter.arrayAutoCollapse": true,
24+
"evenBetterToml.formatter.arrayAutoExpand": true,
25+
"evenBetterToml.formatter.arrayTrailingComma": true,
26+
"evenBetterToml.formatter.compactEntries": false,
27+
"evenBetterToml.formatter.compactInlineTables": false,
28+
"evenBetterToml.formatter.crlf": false,
29+
"evenBetterToml.formatter.indentEntries": false,
30+
"evenBetterToml.formatter.indentTables": false,
31+
}

0 commit comments

Comments
 (0)