ClusterShell nosetests #265
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: ClusterShell nosetests | |
on: [push, pull_request, merge_group] | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12'] | |
include: | |
- os: ubuntu-20.04 | |
python-version: '3.6' | |
name: Tests with Python ${{ matrix.python-version }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5.2.0 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install coverage nose-py3 . | |
- name: Allow us to SSH passwordless to localhost | |
run: | | |
chmod og-rw ~ | |
ssh-keygen -f ~/.ssh/id_rsa -N "" | |
cp ~/.ssh/{id_rsa.pub,authorized_keys} | |
- name: Avoid ssh "known hosts" warnings | |
run: | | |
printf '%s\n %s\n %s\n' 'Host *' 'StrictHostKeyChecking no' 'LogLevel ERROR' >> ~/.ssh/config | |
- name: Set Python paths when sshing for gateway tests | |
run: | | |
sed -i "1iexport CLUSTERSHELL_GW_PYTHON_EXECUTABLE=$(which python)" ~/.bashrc | |
sed -i "2iexport PYTHONPATH=\$PYTHONPATH:$(realpath $pythonLocation/lib/python*/site-packages)" ~/.bashrc | |
head ~/.bashrc | |
- name: Install pdsh to test WorkerPdsh | |
run: | | |
sudo apt-get -y install pdsh | |
sudo sh -c 'echo ssh > /etc/pdsh/rcmd_default' | |
- name: Post to Slack (start) | |
continue-on-error: true | |
id: slack-start | |
uses: slackapi/slack-github-action@v1.24.0 | |
with: | |
channel-id: 'C07GRMDK3' | |
payload: | | |
{ | |
"text": "${{ github.workflow }}: Python ${{ matrix.python-version }} tests started (In Progress)", | |
"attachments": [ | |
{ | |
"color": "#ECB32D", | |
"fields": [ | |
{ | |
"title": "Branch", | |
"short": true, | |
"value": "${{ github.ref }}" | |
}, | |
{ | |
"title": "Actor", | |
"short": true, | |
"value": "${{ github.actor }}" | |
} | |
] | |
} | |
] | |
} | |
env: | |
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} | |
- name: Run tests | |
id: tests | |
run: | | |
python --version | |
export CLUSTERSHELL_GW_PYTHON_EXECUTABLE=$(which python) | |
nosetests -v --all-modules --with-coverage --cover-tests --cover-erase --cover-package=ClusterShell tests | |
- name: Post to Slack (end) | |
if: always() | |
continue-on-error: true | |
id: slack-end | |
uses: slackapi/slack-github-action@v1.24.0 | |
with: | |
channel-id: 'C07GRMDK3' | |
update-ts: ${{ steps.slack-start.outputs.ts }} | |
payload: | | |
{ | |
"text": "${{ github.workflow }}: Python ${{ matrix.python-version }} tests completed", | |
"attachments": [ | |
{ | |
"fields": [ | |
{ | |
"title": "Branch", | |
"short": true, | |
"value": "${{ github.ref }}" | |
}, | |
{ | |
"title": "Status", | |
"short": true, | |
"value": "${{ job.status }}" | |
} | |
] | |
} | |
] | |
} | |
env: | |
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} |