Skip to content
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
49 changes: 44 additions & 5 deletions .github/workflows/cubitpy_test_suite_with_secrets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
cubit_download_url: ${{ env.CUBIT_DOWNLOAD_URL }}
cubit_email: ${{ secrets.CUBIT_EMAIL }}
cubit_password: ${{ secrets.CUBIT_PASSWORD }}
- name: Install CubitPy and run tests
- name: Install CubitPy
run: |
whoami
pwd
Expand All @@ -58,15 +58,54 @@ jobs:
# Print information on the python environment
python --version
pip list

- name: Run CubitPy tests in local mode
run: |
# Create CubitPy config
cat > cubitpy_config_local.yml <<EOF
CONFIG_NAME=cubitpy_config_local.yml
cat > $CONFIG_NAME <<EOF
cubitpy_mode: "local"
local_config:
cubit_path: "$CUBIT_ROOT_PATH"
EOF
cat cubitpy_config_local.yml
export CUBITPY_CONFIG_PATH="$(pwd)/cubitpy_config_local.yml"
cat $CONFIG_NAME
export CUBITPY_CONFIG_PATH="$(pwd)/$CONFIG_NAME"

# Run tests
pytest
# This tests that if cubit is completely closed everything works
cd tests
./test_configurations.sh
env:
CUBIT_ROOT_PATH: ${{ steps.cubit.outputs.cubit_root }}
- name: Setup local SSH server
run: |
sudo apt-get update
sudo apt-get install -y openssh-server

mkdir -p ~/.ssh
ssh-keygen -t ed25519 -N "" -f ~/.ssh/id_ed25519
cat ~/.ssh/id_ed25519.pub >> ~/.ssh/authorized_keys
chmod 700 ~/.ssh
chmod 600 ~/.ssh/authorized_keys
sudo service ssh start
ssh-keyscan -H localhost >> ~/.ssh/known_hosts
- name: Verify SSH connection
run: ssh localhost 'echo SSH to local host successful'
- name: Run CubitPy tests in remote mode
run: |
# Create CubitPy config
SSH_USER="${USER:-$(whoami)}"
CONFIG_NAME=cubitpy_config_remote.yml
cat > $CONFIG_NAME <<EOF
cubitpy_mode: "remote"
remote_config:
user: "$SSH_USER"
host: "localhost"
platform: "linux"
cubit_path: "$CUBIT_ROOT_PATH"
EOF
Comment thread
isteinbrecher marked this conversation as resolved.
cat $CONFIG_NAME
export CUBITPY_CONFIG_PATH="$(pwd)/$CONFIG_NAME"

# Run tests
pytest
Expand Down
Loading