-
Notifications
You must be signed in to change notification settings - Fork 85
107 lines (105 loc) · 3.43 KB
/
nosetests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
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 }}