forked from opensvc/opensvc
-
Notifications
You must be signed in to change notification settings - Fork 0
99 lines (85 loc) · 2.46 KB
/
ci.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
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