Skip to content

Commit

Permalink
Tests: add github python tests
Browse files Browse the repository at this point in the history
  • Loading branch information
cedeyn committed Jul 24, 2024
1 parent a697063 commit c1c94c3
Showing 1 changed file with 58 additions and 0 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Milkcheck

on: [workflow_dispatch, push, pull_request]

permissions:
contents: read
pull-requests: read

jobs:
build:

runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9"]

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install nose clustershell pylint
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Setup SSH keys
run: |
ssh-keygen -t rsa -f ~/.ssh/id_rsa -N ""
cat ~/.ssh/id_rsa.pub >>~/.ssh/authorized_keys
- name: Configure NodeSet
run: |
mkdir -p ~/.config/clustershell/groups.d ~/.config/clustershell/groups.conf.d
cat >>~/.config/clustershell/groups.conf <<EOF
[Main]
default: local
confdir: $CFGDIR/groups.conf.d
autodir: $CFGDIR/groups.d
[local]
map: [ -f $CFGDIR/groups ] && f=$CFGDIR/groups || f=$CFGDIR/groups.d/local.cfg; sed -n 's/^$GROUP:\(.*\)/\1/p' $f
all: [ -f $CFGDIR/groups ] && f=$CFGDIR/groups || f=$CFGDIR/groups.d/local.cfg; sed -n 's/^all:\(.*\)/\1/p' $f
list: [ -f $CFGDIR/groups ] && f=$CFGDIR/groups || f=$CFGDIR/groups.d/local.cfg; sed -n 's/^\([0-9A-Za-z_-]*\):.*/\1/p' $f
EOF
- name: Lint with pylint
run: |
export PYTHONPATH=$PWD/lib/
pylint --fail-under 8.72 lib/
#rc=$?
#fatal=$((rc & 1))
#error=$((rc & 2))
#invocation=$((rc & 32))
#exit $((fatal + error + invocation))
- name: Test with nosetests
run: |
export PYTHONPATH=$PWD/lib/
nosetests --exe --all-modules -w tests --with-coverage

0 comments on commit c1c94c3

Please sign in to comment.