Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SSH test on CI #81

Merged
merged 34 commits into from
Mar 10, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 29 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,40 @@ jobs:
- name: Basic GitHub action setup
uses: actions/checkout@v2

- name: Set conda environment "test"
uses: conda-incubator/setup-miniconda@v2
- name: Install SSH server
if: runner.os == 'Linux'
run: |
sudo apt-get install openssh-server
ssh-keygen -t rsa -q -f "$HOME/.ssh/id_rsa" -N ""
cat "$HOME/.ssh/id_rsa.pub" >> "$HOME/.ssh/authorized_keys"
chmod g-w "$HOME"
chmod o-w "$HOME"
chmod 700 "$HOME/.ssh"
chmod 600 "$HOME/.ssh/authorized_keys"
ssh -o "StrictHostKeyChecking accept-new" -v localhost "uname -r"

- name: Set conda environment
uses: mamba-org/provision-with-micromamba@main
with:
mamba-version: "*"
channels: conda-forge,defaults
channel-priority: true
environment-file: environment.yaml
activate-environment: test
auto-activate-base: false
environment-name: myenv

- name: Install library
run: python -m pip install .

- name: Run tests
run: python test/main.py

- name: Prepare SSH test
if: runner.os == 'Linux'
working-directory: test
run: |
python ssh_generate.py
mkdir remote
cp -r myssh_get remote/
cp -r myssh_send remote/

- name: Run SSH tests
if: runner.os == 'Linux'
working-directory: test
run: python ssh_test.py --host localhost --prefix "${PWD}/remote"