Merge pull request #670 from cvaroqui/b2.1 #126
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: OpenSVC agent CI | |
on: | |
push: | |
branches: | |
- b2.0 | |
- b2.1 | |
pull_request: | |
branches: | |
- b2.0 | |
- b2.1 | |
jobs: | |
ci-pytest: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- python-version: 3.8 | |
PYTEST_EXTRA_ARGS: "--cov" | |
steps: | |
- name: Checkout opensvc | |
uses: actions/checkout@v2 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install system dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get -y install procps | |
- name: Install python dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r test-requirements.txt | |
- name: Run pytest | |
env: | |
OPENSVC_CI_EXTRA_TIME_OSVCD_STARTUP: 25 | |
run: sudo $(which pytest) ${{ matrix.PYTEST_EXTRA_ARGS }} -m "ci" | |
- name: Run coverage report | |
if: ${{ success() && matrix.PYTEST_EXTRA_ARGS == '--cov' }} | |
run: | | |
coverage report | |
ci-pylint: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- python-version: 3.8 | |
PYTEST_EXTRA_ARGS: "--cov" | |
steps: | |
- name: Checkout opensvc | |
uses: actions/checkout@v2 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install system dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get -y install procps | |
- name: Install python dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r test-requirements.txt | |
- name: Run pylint | |
env: | |
PYTHONPATH: opensvc | |
run: pylint -E opensvc/*py opensvc/commands opensvc/core opensvc/daemon opensvc/drivers opensvc/utilities | |
slack-workflow-status: | |
if: always() | |
name: Post Workflow Status To Slack | |
needs: | |
- ci-pytest | |
- ci-pylint | |
runs-on: ubuntu-latest | |
continue-on-error: true | |
steps: | |
- name: Slack Workflow Notification | |
uses: Gamesight/slack-workflow-status@master | |
with: | |
repo_token: ${{secrets.GITHUB_TOKEN}} | |
slack_webhook_url: ${{secrets.SLACK_WEBHOOK_URL}} | |
icon_emoji: ':poop:' | |
if: env.slack_webhook_url != null | |