-
Notifications
You must be signed in to change notification settings - Fork 3
142 lines (119 loc) · 3.97 KB
/
continuous-integration.yml
File metadata and controls
142 lines (119 loc) · 3.97 KB
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
name: Continuous Integration
# Lightweight PR validation workflow
# Clean architecture replacing broken ci.yml for branch/PR testing
on:
pull_request:
branches:
- master
- 'plan/**'
- 'feature/**'
push:
branches:
- 'plan/**'
- 'feature/**'
# Exclude master to avoid duplicate runs with release-pipeline
env:
PYTHON_VERSION: '3.11'
jobs:
# Quick validation for PRs and branch pushes
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('requirements-dev.lock') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y libhdf5-dev pkg-config
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-dev.lock
pip install -e .
- name: Run core tests
run: |
pytest --tb=short --disable-warnings tests/
- name: Check code formatting
run: |
black --check solarwindpy/
flake8 solarwindpy/
- name: Verify imports
run: |
python -c "import solarwindpy as swp; print(f'SolarWindPy imported successfully')"
# Extended validation for plan branches (more comprehensive)
extended-validation:
runs-on: ${{ matrix.os }}
if: startsWith(github.ref, 'refs/heads/plan/')
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
python-version: ['3.11', '3.12', '3.13']
fail-fast: false
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('requirements-dev.lock') }}
restore-keys: |
${{ runner.os }}-pip-${{ matrix.python-version }}-
${{ runner.os }}-pip-
- name: Install system dependencies (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y libhdf5-dev pkg-config
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-dev.lock
pip install -e .
- name: Run comprehensive tests
run: |
pytest --tb=short --disable-warnings
- name: Check imports and basic functionality
run: |
python -c "
import solarwindpy as swp
print(f'SolarWindPy version: {swp.__version__}')
# Test core functionality
import numpy as np
from solarwindpy.core import Plasma, Ion
print('Core classes imported successfully')
"
# Summary job
ci-summary:
needs: [validate, extended-validation]
runs-on: ubuntu-latest
if: always()
steps:
- name: CI Summary
run: |
echo "🏁 Continuous Integration Summary"
echo "Branch: ${{ github.ref_name }}"
echo "Event: ${{ github.event_name }}"
echo ""
echo "Job Results:"
echo "- Quick Validation: ${{ needs.validate.result }}"
echo "- Extended Validation: ${{ needs.extended-validation.result || 'skipped' }}"
echo ""
if [[ "${{ needs.validate.result }}" == "success" ]]; then
echo "✅ PR validation passed - ready for review"
else
echo "❌ PR validation failed - requires fixes"
fi