Skip to content

move handle into connect #768

move handle into connect

move handle into connect #768

Workflow file for this run

name: Rust
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
env:
RUSTFLAGS: -Dwarnings
RUSTDOCFLAGS: -Dwarnings
RUST_BACKTRACE: 1
CARGO_TERM_COLOR: always
SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: "sccache"
CARGO_INCREMENTAL: 0
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
on:
push:
paths-ignore:
- 'README.md'
- 'LICENSE'
- '.gitignore'
pull_request:
paths-ignore:
- 'README.md'
- 'LICENSE'
- '.gitignore'
jobs:
os-check:
runs-on: ubuntu-latest
name: os check on ${{ matrix.target }}
strategy:
fail-fast: false
matrix:
include:
- { target: x86_64-pc-windows-msvc, args: "--exclude-features openssh" }
- { target: x86_64-apple-darwin }
- { target: x86_64-unknown-linux-gnu }
steps:
- uses: actions/checkout@v3
- name: Install toolchain
run: |
rustup toolchain install stable --no-self-update --profile minimal --target ${{ matrix.target }}
- uses: taiki-e/install-action@v2
with:
tool: cargo-hack
- name: Create Cargo.lock for caching
run: cargo update
- uses: actions/cache@v3
with:
path: |
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
key: cargo-index-os-check-${{ matrix.target }}-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
cargo-index-os-check-${{ matrix.target }}
cargo-index-os-check-
cargo-index-
- uses: mozilla-actions/sccache-action@v0.0.3
- run: |
cargo hack check --feature-powerset --target ${{ matrix.target }} ${{ matrix.args }}
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: 'recursive'
- name: Install toolchain
run: |
rustup toolchain install stable --component rustfmt,clippy --no-self-update --profile minimal
rustup toolchain install nightly --no-self-update --profile minimal
- name: Create Cargo.lock for caching
run: cargo update
- uses: actions/cache@v3
with:
path: |
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
key: cargo-index-check-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
cargo-index-check-
cargo-index-
- uses: mozilla-actions/sccache-action@v0.0.3
- run: ./check.sh
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: 'recursive'
- name: Install toolchain
run: rustup toolchain install stable --no-self-update --profile minimal
- name: Create Cargo.lock for caching
run: cargo update
- uses: actions/cache@v3
with:
path: |
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
key: cargo-index-build-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
cargo-index-build-
cargo-index-
- uses: mozilla-actions/sccache-action@v0.0.3
- name: Compile tests
run: cargo test --all-features --workspace --no-run
- name: Test ssh connectivity
run: |
# Wait for startup of openssh-server
timeout 15 ./wait_for_sshd_start_up.sh
chmod 600 .test-key
mkdir /tmp/openssh-rs
ssh -i .test-key -v -p 2222 -l test-user 127.0.0.1 -o StrictHostKeyChecking=accept-new -o UserKnownHostsFile=/tmp/openssh-rs/known_hosts whoami
- name: Set up ssh-agent
run: |
eval $(ssh-agent)
echo "SSH_AUTH_SOCK=$SSH_AUTH_SOCK" >> $GITHUB_ENV
echo "SSH_AGENT_PID=$SSH_AGENT_PID" >> $GITHUB_ENV
cat .test-key | ssh-add -
- name: Run tests
run: ./run_tests.sh
env:
XDG_RUNTIME_DIR: /tmp
- name: ssh container log
run: docker logs $(docker ps | grep openssh-server | awk '{print $1}')
if: ${{ failure() }}
- run: docker exec $(docker ps | grep openssh-server | awk '{print $1}') ls -R /config/logs/
if: ${{ failure() }}
- run: docker exec $(docker ps | grep openssh-server | awk '{print $1}') cat /config/logs/openssh/current
name: ssh server log
if: ${{ failure() }}
services:
openssh:
image: linuxserver/openssh-server:amd64-latest
ports:
- 2222:2222
env:
USER_NAME: test-user
PUBLIC_KEY: |-
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGzHvK2pKtSlZXP9tPYOOBb/xn0IiC9iLMS355AYUPC7
DOCKER_MODS: linuxserver/mods:openssh-server-ssh-tunnel