Skip to content

Commit 2472217

Browse files
restoring workflows
1 parent bbd4c20 commit 2472217

File tree

2 files changed

+114
-0
lines changed

2 files changed

+114
-0
lines changed

.github/workflows/pytest.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
3+
4+
name: build
5+
6+
on:
7+
push:
8+
branches:
9+
- main
10+
- develop
11+
pull_request:
12+
13+
jobs:
14+
build:
15+
16+
runs-on: ubuntu-latest
17+
strategy:
18+
matrix:
19+
python-version: ['3.9', '3.10', '3.11', '3.12']
20+
21+
steps:
22+
- uses: actions/checkout@v3
23+
- name: Set up Python ${{ matrix.python-version }}
24+
uses: actions/setup-python@v3
25+
with:
26+
python-version: ${{ matrix.python-version }}
27+
- name: Install dependencies
28+
run: |
29+
python -m pip install --upgrade pip setuptools
30+
pip install -e .[test] # coverage reports need -e to capture properly
31+
- name: Lint with flake8
32+
run: |
33+
pip install flake8
34+
# stop the build if there are Python syntax errors or undefined names
35+
flake8 pori_python --count --select=E9,F63,F7,F82 --show-source --statistics
36+
- name: Check with black
37+
run: |
38+
pip install black
39+
black --check -S -l 100 pori_python tests
40+
- name: Full Tests with pytest
41+
run: |
42+
pip list
43+
pytest --junitxml=junit/test-results-${{ matrix.python-version }}.xml --cov pori_python --cov-report term --cov-report xml
44+
env:
45+
IPR_USER: ${{ secrets.IPR_TEST_USER }}
46+
IPR_PASS: ${{ secrets.IPR_TEST_PASSWORD }}
47+
GRAPHKB_USER: ${{ secrets.GKB_TEST_USER }}
48+
GRAPHKB_PASS: ${{ secrets.GKB_TEST_PASS }}
49+
# SDEV-3381 - Turn off integration tests temporarily, till efficiency is increased
50+
# turn on integration tests for one python version only
51+
EXCLUDE_INTEGRATION_TESTS: ${{ matrix.python-version != '3.11' }}
52+
- name: Upload pytest test results
53+
uses: actions/upload-artifact@master
54+
with:
55+
name: pytest-results-${{ matrix.python-version }}
56+
path: junit/test-results-${{ matrix.python-version }}.xml
57+
# Use always() to always run this step to publish test results when there are test failures
58+
if: matrix.python-version == 3.9
59+
- name: Update code coverage report to CodeCov
60+
uses: codecov/codecov-action@v3
61+
with:
62+
token: ${{ secrets.CODECOV_TOKEN }}
63+
file: ./coverage.xml
64+
flags: unittests
65+
env_vars: OS,PYTHON
66+
name: codecov-umbrella
67+
fail_ci_if_error: true
68+
if: matrix.python-version == 3.9

.github/workflows/quick-pytest.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
3+
4+
name: quick-tests
5+
6+
on:
7+
push:
8+
9+
jobs:
10+
build:
11+
12+
runs-on: ubuntu-latest
13+
strategy:
14+
max-parallel: 4
15+
matrix:
16+
python-version: ['3.11']
17+
18+
steps:
19+
- uses: actions/checkout@v3
20+
- name: Set up Python ${{ matrix.python-version }}
21+
uses: actions/setup-python@v3
22+
with:
23+
python-version: ${{ matrix.python-version }}
24+
- name: Install dependencies
25+
run: |
26+
python -m pip install --upgrade pip setuptools
27+
pip install -e .[test] # coverage reports need -e to capture properly
28+
- name: Lint with flake8
29+
run: |
30+
pip install flake8
31+
# stop the build if there are Python syntax errors or undefined names
32+
flake8 pori_python --count --select=E9,F63,F7,F82 --show-source --statistics
33+
- name: Check with black
34+
run: |
35+
pip install black
36+
black --check -S -l 100 pori_python tests
37+
- name: Short Tests with pytest
38+
run: pytest --junitxml=junit/test-results-${{ matrix.python-version }}.xml --cov ipr --cov-report term --cov-report xml
39+
env:
40+
IPR_USER: ${{ secrets.IPR_TEST_USER }}
41+
IPR_PASS: ${{ secrets.IPR_TEST_PASSWORD }}
42+
GRAPHKB_USER: ${{ secrets.GKB_TEST_USER }}
43+
GRAPHKB_PASS: ${{ secrets.GKB_TEST_PASS }}
44+
EXCLUDE_INTEGRATION_TESTS: 1
45+
# EXCLUDE_INTEGRATION_TESTS: ${{ matrix.python-version != '3.11' }}
46+
if: github.event_name != 'pull_request'

0 commit comments

Comments
 (0)