forked from WCRP-CMIP/CMIP7_DReq_Software
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathpip_install.yml
49 lines (40 loc) · 1.58 KB
/
pip_install.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
name: Python Package Installation Test Matrix
on:
push:
branches:
- '*'
pull_request:
branches:
- '*'
jobs:
test-install:
strategy:
matrix:
os: [ubuntu-20.04, ubuntu-22.04, macos-latest, windows-latest]
python-version: ["3.10", "3.11", "3.12", "3.13"]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install .
continue-on-error: false # Allow the job to continue even if installation fails
- name: Run tests
run: |
pytest --maxfail=1 --disable-warnings -q || exit 1 # Fail this step if tests fail
continue-on-error: false # Allow the job to continue even if tests fail
- name: Output result
run: |
echo "Install test completed for Python ${{ matrix.python-version }} on OS ${{ matrix.os }}."
- name: Add annotations for installation and testing failures
if: failure() # This step only runs if any previous step fails
run: |
echo "Installation or test failed for Python ${{ matrix.python-version }} on OS ${{ matrix.os }}."
echo "::error file=install_test_report.txt,line=1::Installation or test failed for Python ${{ matrix.python-version }} on OS ${{ matrix.os }}"