Skip to content

Commit bd24057

Browse files
Add default and advanced prechecks workflows for Unix (#203)
* Change trigger for unix/windows workflows * Add advanced prechecks for unix * Add default prechecks for unix * Add docs * Change code segment meta
1 parent d4a1cf4 commit bd24057

File tree

4 files changed

+51
-18
lines changed

4 files changed

+51
-18
lines changed

.github/workflows/prechecks-unix.yml .github/workflows/advanced-prechecks-unix.yml

+5-11
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
1-
name: "Prechecks Unix"
1+
name: "Advanced Prechecks Unix"
22

33
on:
44
pull_request:
55
branches: [ master ]
6+
types: [ labeled ]
67
paths-ignore:
78
- "*.md"
8-
- "windows/**"
9-
- "libvirt/**"
9+
- "!unix/**"
1010
- "unix/prechecks/**"
1111

1212
jobs:
1313
ubuntu:
1414
runs-on: ubuntu-latest
15+
if: ${{ github.event.label.name == 'ci' }}
1516
strategy:
1617
matrix:
1718
python-version: [ '3.7', '3.8', '3.9', '3.10' ]
@@ -27,14 +28,6 @@ jobs:
2728
- name: Install pipenv
2829
run: python -m pip install --upgrade pipenv wheel
2930

30-
- name: Install flake8
31-
run: pip install flake8
32-
33-
## Check linting ##
34-
- name: Run flake8 linter
35-
working-directory: unix
36-
run: flake8 ./src --config ./setup.cfg
37-
3831
## Check packaging ##
3932
- name: Install dependencies
4033
working-directory: unix
@@ -46,6 +39,7 @@ jobs:
4639

4740
rhel:
4841
runs-on: ubuntu-latest
42+
if: ${{ github.event.label.name == 'ci' }}
4943
strategy:
5044
matrix:
5145
python-version: [ '3.6', '3.8', '3.9', '3.10' ]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: "Default Prechecks Unix"
2+
3+
on:
4+
pull_request:
5+
branches: [ master ]
6+
paths-ignore:
7+
- "*.md"
8+
- "!unix/**"
9+
- "unix/prechecks/**"
10+
11+
jobs:
12+
ubuntu:
13+
runs-on: ubuntu-latest
14+
name: Ubuntu Default Prechecks
15+
steps:
16+
- uses: actions/checkout@v3
17+
18+
- uses: actions/setup-python@v3
19+
with:
20+
python-version: 3.8
21+
architecture: x64
22+
23+
- name: Install pipenv
24+
run: python -m pip install --upgrade pipenv wheel
25+
26+
- name: Install flake8
27+
run: pip install flake8
28+
29+
## Check linting ##
30+
- name: Run flake8 linter
31+
working-directory: unix
32+
run: flake8 ./src --config ./setup.cfg

.github/workflows/prechecks-windows.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ on:
55
branches: [ master ]
66
paths-ignore:
77
- "*.md"
8-
- "unix/**"
9-
- "libvirt/**"
8+
- "!windows/**"
109

1110
jobs:
1211
windows:

unix/CONTRIBUTING.md

+13-5
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ it's 3.9. You can use any operating system.
1414
Install all development dependencies using:
1515

1616
```console
17-
$ pipenv install --dev
17+
pipenv install --dev
1818
```
1919

2020
If you haven't used `pipenv` before but are comfortable with virtualenvs, just
@@ -28,9 +28,9 @@ run `pipenv run machine_stats` to run it locally.
2828
Non `pipenv` install works too:
2929

3030
```console
31-
$ pip install -r requirements.txt
32-
$ pip install -r dev-requirements.txt
33-
$ pip install -e .
31+
pip install -r requirements.txt
32+
pip install -r dev-requirements.txt
33+
pip install -e .
3434
```
3535

3636
### Tools
@@ -55,14 +55,22 @@ For example, if the current version in `1.0.0`:
5555

5656
After that all you need to do is to run
5757

58-
```
58+
```console
5959
git push origin master
6060
git push origin --tags
6161
```
6262

6363
This will update the version and trigger the PyPI build and deploy.
6464

6565
_Note_: You can verify that the version has been updated after running the `bump2version` command by checking the `config.cfg` file. (current_version)
66+
67+
### Introducing breaking changes?
68+
69+
When you create a PR, the GitHub workflows check for the linting and CodeQL. However, if you think you're introducing breaking changes, then please add the label `ci` with your PR. This will run the Advanced Prechecks workflow that checks Machine Stats' working in the following system environments:
70+
71+
* Ubuntu 20.04 - Python 3.7 to 3.10
72+
* RHEL 8 - Python 3.6, 3.8 to 3.10
73+
6674
## Finally
6775

6876
Thanks again for your interest in improving the project! You're taking action

0 commit comments

Comments
 (0)