Skip to content

Commit

Permalink
Merge branch 'feature/github_ci' into 'master'
Browse files Browse the repository at this point in the history
Update of GitHub CI file

See merge request caimira/caimira!511
  • Loading branch information
lrdossan committed Oct 23, 2024
2 parents 23c8a34 + 349f2df commit 6e16feb
Showing 1 changed file with 127 additions and 30 deletions.
157 changes: 127 additions & 30 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,50 +19,147 @@ on:
default: 'Manual trigger'

jobs:
test-install:
test-caimira-py311:
name: Test CAiMIRA with Python 3.11
runs-on: ubuntu-latest
env:
PROJECT_ROOT: ./
PROJECT_NAME: caimira
CAIMIRA_TESTS_CALCULATOR_TIMEOUT: 30
PROJECT_ROOT: "caimira"
PY_VERSION: "3.11"
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Checkout Repository
uses: actions/checkout@v3

- name: Set up Python 3.9
uses: actions/setup-python@v2
- name: Set up Python ${{ env.PY_VERSION }}
uses: actions/setup-python@v4
with:
python-version: 3.9
python-version: ${{ env.PY_VERSION }}

- name: Install dependencies
- name: Cache pip
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt', '**/setup.py') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install Dependencies
run: |
cd ${{ env.PROJECT_ROOT }}
pip install --upgrade pip
pip install -e .[test]
- name: Run Tests
run: |
cd caimira
python -m pytest
test-cern-caimira-py311:
name: Test CERN CAiMIRA with Python 3.11
runs-on: ubuntu-latest
if: github.ref != 'refs/heads/live/caimira-test' && !startsWith(github.ref, 'refs/tags/')
env:
PROJECT_ROOT: "cern_caimira"
PY_VERSION: "3.11"
steps:
- name: Checkout Repository
uses: actions/checkout@v3

- name: Set up Python ${{ env.PY_VERSION }}
uses: actions/setup-python@v4
with:
python-version: ${{ env.PY_VERSION }}

- name: Cache pip
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt', '**/setup.py') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install Dependencies
run: |
cd caimira
pip install --upgrade pip
pip install -e .[test]
cd ../${{ env.PROJECT_ROOT }}
pip install --upgrade pip
pip install -e .[test]
- name: Run Tests
run: |
python -m pip install ${PROJECT_ROOT}[test]
cd cern_caimira
python -m pytest
test-caimira-py39:
name: Test CAiMIRA with Python 3.9
runs-on: ubuntu-latest
if: github.ref != 'refs/heads/live/caimira-test' && !startsWith(github.ref, 'refs/tags/')
env:
PROJECT_ROOT: "caimira"
PY_VERSION: "3.9"
steps:
- name: Checkout Repository
uses: actions/checkout@v3

- name: Set up Python ${{ env.PY_VERSION }}
uses: actions/setup-python@v4
with:
python-version: ${{ env.PY_VERSION }}

- name: Run tests
- name: Cache pip
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt', '**/setup.py') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install Dependencies
run: |
cd ${{ env.PROJECT_ROOT }}
pip install --upgrade pip
pip install -e .[test]
- name: Run Tests
run: |
mkdir -p ~/not-the-source-dir && cd ~/not-the-source-dir
python -m pytest --pyargs ${PROJECT_NAME}
test-dev:
runs-on: ubuntu-20.04
cd caimira
python -m pytest
test-cern-caimira-py39:
name: Test CERN CAiMIRA with Python 3.9
runs-on: ubuntu-latest
if: github.ref != 'refs/heads/live/caimira-test' && !startsWith(github.ref, 'refs/tags/')
env:
PROJECT_ROOT: ./
PROJECT_NAME: caimira
CAIMIRA_TESTS_CALCULATOR_TIMEOUT: 30
PROJECT_ROOT: "cern_caimira"
PY_VERSION: "3.9"
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Checkout Repository
uses: actions/checkout@v3

- name: Set up Python ${{ env.PY_VERSION }}
uses: actions/setup-python@v4
with:
python-version: ${{ env.PY_VERSION }}

- name: Set up Python 3.9
uses: actions/setup-python@v2
- name: Cache pip
uses: actions/cache@v3
with:
python-version: 3.9
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt', '**/setup.py') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
- name: Install Dependencies
run: |
python -m pip install -e ${PROJECT_ROOT}[test]
python -m pip install pytest-cov
cd caimira
pip install --upgrade pip
pip install -e .[test]
cd ../${{ env.PROJECT_ROOT }}
pip install --upgrade pip
pip install -e .[test]
- name: Run tests
- name: Run Tests
run: |
cd ${PROJECT_ROOT}
python -m pytest ./${PROJECT_NAME} --cov=${PROJECT_NAME} --junitxml=report.xml
cd cern_caimira
python -m pytest

0 comments on commit 6e16feb

Please sign in to comment.