Skip to content
Merged
Show file tree
Hide file tree
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
47 changes: 47 additions & 0 deletions .github/workflows/pyslurm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: PySlurm
on: [push]
jobs:
Build:
runs-on: ubuntu-20.04
strategy:
matrix:
python-version:
- "3.6"
- "3.7"
- "3.8"
- "3.9"
fail-fast: false
steps:
- name: Checkout repository code
uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install Dependencies
run: |
which python
which python${{ matrix.python-version }}
python${{ matrix.python-version }} -m pip install --upgrade pip
python${{ matrix.python-verison }} -m pip install pipenv
pipenv --python ${{matrix.python-version }} install --dev --skip-lock
- name: Start Slurm Container
uses: sudo-bot/action-docker-compose@latest

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for using my action !
Feel free to ping me directly in case of any incident

with:
cli-args: "-f docker-compose-github.yml up -d"
env:
PYTHON: ${{ matrix.python-version }}
- name: Debug
run: |
docker ps -a
docker version
pwd
ls -al
docker inspect slurmctl
env | sort
- name: Build/Install/Test PySlurm
run: |
pipenv run pytest -sv scripts/run_tests_in_container.py
env:
PYTHON: ${{ matrix.python-version }}

28 changes: 0 additions & 28 deletions .travis.yml

This file was deleted.

4 changes: 2 additions & 2 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
PySlurm: Slurm Interface for Python
***********************************

.. image:: https://travis-ci.org/PySlurm/pyslurm.svg?branch=20.11
:target: https://travis-ci.org/PySlurm/pyslurm
.. image:: https://github.com/PySlurm/pyslurm/actions/workflows/pyslurm.yml/badge.svg
:target: https://github.com/PySlurm/pyslurm/actions/workflows/pyslurm.yml

Overview
========
Expand Down
14 changes: 14 additions & 0 deletions docker-compose-github.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: "3.8"

services:
slurm:
image: giovtorres/docker-centos7-slurm:20.11.8
hostname: slurmctl
container_name: slurmctl
stdin_open: true
tty: true
working_dir: /pyslurm
environment:
PYTHON: "3.9"
volumes:
- ${RUNNER_WORKSPACE}/pyslurm:/pyslurm
11 changes: 9 additions & 2 deletions scripts/run_tests_in_container.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
"""Execute pytest inside the container."""

import os

import testinfra


def test_run():
host = testinfra.get_host(f"docker://slurmctl")
print(host.check_output("python3.9 setup.py build"))
print(host.check_output("python3.9 setup.py install"))
python = f'python{os.environ.get("PYTHON")}'
print(host.check_output(f"{python} setup.py build"))
print(host.check_output(f"{python} setup.py install"))
print(host.check_output("./scripts/configure.sh"))
print(host.check_output(f"{python} -m pip uninstall --yes pytest"))
print(host.check_output(f"{python} -m pip install pytest"))
print(host.check_output("pytest -v"))