Skip to content

update github actions #54

update github actions

update github actions #54

Workflow file for this run

name: SSHLibrary Jython CI
on: [push, pull_request]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
java: ["8.0.422+5"]
os: ["ubuntu-latest"]
jython-version: ["2.7.2"]
steps:
- uses: actions/checkout@v4
- name: Setup Java ${{ matrix.java }}
uses: actions/setup-java@v4
with:
distribution: "temurin"
java-version: ${{ matrix.java }}
architecture: "x64"
- name: Install dependencies
run: |
wget -nv "http://search.maven.org/remotecontent?filepath=org/python/jython-installer/${{ matrix.jython-version }}/jython-installer-${{ matrix.jython-version }}.jar" -O jytinst.jar
java -jar jytinst.jar -s -d jython/
jython/bin/jython -m easy_install robotframework==4.1.3 robotstatuschecker==1.5.1 robotbackgroundlogger
- name: Configure test environment for Linux
run: |
sudo useradd test -m -s /bin/bash
(echo 'test'; echo 'test') | sudo passwd test
sudo -E su test -c "echo $'export PS1=\'\u@$HOSTNAME \W \$ \'' >> /home/test/.bashrc"
sudo sh -c "echo 'test ALL=(ALL:ALL) PASSWD:ALL' > /etc/sudoers.d/passworded"
sudo useradd -m testkey -s /bin/bash
sudo -E su testkey -c "echo $'export PS1=\'\u@$HOSTNAME \W \$ \'' >> /home/testkey/.bashrc"
sudo -E su testkey -c "mkdir -p /home/testkey/.ssh"
sudo -E su testkey -c "ssh-keygen -f /home/testkey/.ssh/id_rsa -t rsa -N ''"
sudo -E su testkey -c "cp /home/testkey/.ssh/id_rsa.pub /home/testkey/.ssh/authorized_keys"
sudo -E su testkey -c "chmod 644 /home/testkey/.ssh/id_rsa"
sudo -E su testkey -c "chmod 600 /home/testkey/.ssh/authorized_keys"
cp /home/testkey/.ssh/id_rsa atest/testdata/keyfiles/
sudo -E su testkey -c "chmod 700 /home/testkey/.ssh"
sudo -E su testkey -c "chmod 600 /home/testkey/.ssh/id_rsa"
sudo chmod 600 atest/testdata/keyfiles/id_rsa
sudo bash -c "echo 'Testing pre-login banner' > /etc/ssh/sshd-banner"
sudo bash -c "echo 'Banner /etc/ssh/sshd-banner' >> /etc/ssh/sshd_config"
sudo bash -c "echo 'Subsystem subsys echo \"Subsystem invoked.\"' >> /etc/ssh/sshd_config"
mkdir ~/.ssh
echo $'Host test_hostname\n Hostname localhost\n User test\n Port 22\n' >> ~/.ssh/config
echo $'Host testkey_hostname\n Hostname localhost\n User testkey\n Port 22\n IdentityFile atest/testdata/keyfiles/id_rsa\n' >> ~/.ssh/config
echo $'Host test_proxy_hostname\n Hostname localhost\n User test\n Port 22\n ProxyCommand ssh -W %h:%p testkey_hostname\n' >> ~/.ssh/config
sudo useradd test-nopasswd -m -s /bin/bash
sudo passwd --delete test-nopasswd
sudo bash -c "echo 'PermitEmptyPasswords yes' >> /etc/ssh/sshd_config"
sudo service ssh restart
eval "$(ssh-agent -s)"
ssh-add atest/testdata/keyfiles/id_rsa
- name: Run tests
run: |
export CLASSPATH=$CLASSPATH:./lib/*
jython/bin/jython atest/run.py -e no-gh-actions atest
- uses: actions/upload-artifact@v4
if: success() || failure()
with:
name: Test Results - ${{ runner.os }}
path: "atest/results/"