Skip to content

Commit 349f2df

Browse files
committed
testing new github ci file
1 parent 09f0514 commit 349f2df

File tree

1 file changed

+127
-30
lines changed

1 file changed

+127
-30
lines changed

.github/workflows/tests.yml

+127-30
Original file line numberDiff line numberDiff line change
@@ -19,50 +19,147 @@ on:
1919
default: 'Manual trigger'
2020

2121
jobs:
22-
test-install:
22+
test-caimira-py311:
23+
name: Test CAiMIRA with Python 3.11
2324
runs-on: ubuntu-latest
2425
env:
25-
PROJECT_ROOT: ./
26-
PROJECT_NAME: caimira
27-
CAIMIRA_TESTS_CALCULATOR_TIMEOUT: 30
26+
PROJECT_ROOT: "caimira"
27+
PY_VERSION: "3.11"
2828
steps:
29-
- name: Checkout
30-
uses: actions/checkout@v2
29+
- name: Checkout Repository
30+
uses: actions/checkout@v3
3131

32-
- name: Set up Python 3.9
33-
uses: actions/setup-python@v2
32+
- name: Set up Python ${{ env.PY_VERSION }}
33+
uses: actions/setup-python@v4
3434
with:
35-
python-version: 3.9
35+
python-version: ${{ env.PY_VERSION }}
3636

37-
- name: Install dependencies
37+
- name: Cache pip
38+
uses: actions/cache@v3
39+
with:
40+
path: ~/.cache/pip
41+
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt', '**/setup.py') }}
42+
restore-keys: |
43+
${{ runner.os }}-pip-
44+
45+
- name: Install Dependencies
46+
run: |
47+
cd ${{ env.PROJECT_ROOT }}
48+
pip install --upgrade pip
49+
pip install -e .[test]
50+
51+
- name: Run Tests
52+
run: |
53+
cd caimira
54+
python -m pytest
55+
56+
test-cern-caimira-py311:
57+
name: Test CERN CAiMIRA with Python 3.11
58+
runs-on: ubuntu-latest
59+
if: github.ref != 'refs/heads/live/caimira-test' && !startsWith(github.ref, 'refs/tags/')
60+
env:
61+
PROJECT_ROOT: "cern_caimira"
62+
PY_VERSION: "3.11"
63+
steps:
64+
- name: Checkout Repository
65+
uses: actions/checkout@v3
66+
67+
- name: Set up Python ${{ env.PY_VERSION }}
68+
uses: actions/setup-python@v4
69+
with:
70+
python-version: ${{ env.PY_VERSION }}
71+
72+
- name: Cache pip
73+
uses: actions/cache@v3
74+
with:
75+
path: ~/.cache/pip
76+
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt', '**/setup.py') }}
77+
restore-keys: |
78+
${{ runner.os }}-pip-
79+
80+
- name: Install Dependencies
81+
run: |
82+
cd caimira
83+
pip install --upgrade pip
84+
pip install -e .[test]
85+
cd ../${{ env.PROJECT_ROOT }}
86+
pip install --upgrade pip
87+
pip install -e .[test]
88+
89+
- name: Run Tests
3890
run: |
39-
python -m pip install ${PROJECT_ROOT}[test]
91+
cd cern_caimira
92+
python -m pytest
93+
94+
test-caimira-py39:
95+
name: Test CAiMIRA with Python 3.9
96+
runs-on: ubuntu-latest
97+
if: github.ref != 'refs/heads/live/caimira-test' && !startsWith(github.ref, 'refs/tags/')
98+
env:
99+
PROJECT_ROOT: "caimira"
100+
PY_VERSION: "3.9"
101+
steps:
102+
- name: Checkout Repository
103+
uses: actions/checkout@v3
104+
105+
- name: Set up Python ${{ env.PY_VERSION }}
106+
uses: actions/setup-python@v4
107+
with:
108+
python-version: ${{ env.PY_VERSION }}
40109

41-
- name: Run tests
110+
- name: Cache pip
111+
uses: actions/cache@v3
112+
with:
113+
path: ~/.cache/pip
114+
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt', '**/setup.py') }}
115+
restore-keys: |
116+
${{ runner.os }}-pip-
117+
118+
- name: Install Dependencies
119+
run: |
120+
cd ${{ env.PROJECT_ROOT }}
121+
pip install --upgrade pip
122+
pip install -e .[test]
123+
124+
- name: Run Tests
42125
run: |
43-
mkdir -p ~/not-the-source-dir && cd ~/not-the-source-dir
44-
python -m pytest --pyargs ${PROJECT_NAME}
45-
test-dev:
46-
runs-on: ubuntu-20.04
126+
cd caimira
127+
python -m pytest
128+
129+
test-cern-caimira-py39:
130+
name: Test CERN CAiMIRA with Python 3.9
131+
runs-on: ubuntu-latest
132+
if: github.ref != 'refs/heads/live/caimira-test' && !startsWith(github.ref, 'refs/tags/')
47133
env:
48-
PROJECT_ROOT: ./
49-
PROJECT_NAME: caimira
50-
CAIMIRA_TESTS_CALCULATOR_TIMEOUT: 30
134+
PROJECT_ROOT: "cern_caimira"
135+
PY_VERSION: "3.9"
51136
steps:
52-
- name: Checkout
53-
uses: actions/checkout@v2
137+
- name: Checkout Repository
138+
uses: actions/checkout@v3
139+
140+
- name: Set up Python ${{ env.PY_VERSION }}
141+
uses: actions/setup-python@v4
142+
with:
143+
python-version: ${{ env.PY_VERSION }}
54144

55-
- name: Set up Python 3.9
56-
uses: actions/setup-python@v2
145+
- name: Cache pip
146+
uses: actions/cache@v3
57147
with:
58-
python-version: 3.9
148+
path: ~/.cache/pip
149+
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt', '**/setup.py') }}
150+
restore-keys: |
151+
${{ runner.os }}-pip-
59152
60-
- name: Install dependencies
153+
- name: Install Dependencies
61154
run: |
62-
python -m pip install -e ${PROJECT_ROOT}[test]
63-
python -m pip install pytest-cov
155+
cd caimira
156+
pip install --upgrade pip
157+
pip install -e .[test]
158+
cd ../${{ env.PROJECT_ROOT }}
159+
pip install --upgrade pip
160+
pip install -e .[test]
64161
65-
- name: Run tests
162+
- name: Run Tests
66163
run: |
67-
cd ${PROJECT_ROOT}
68-
python -m pytest ./${PROJECT_NAME} --cov=${PROJECT_NAME} --junitxml=report.xml
164+
cd cern_caimira
165+
python -m pytest

0 commit comments

Comments
 (0)