-
Notifications
You must be signed in to change notification settings - Fork 50
167 lines (142 loc) · 5.2 KB
/
test_pkg.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
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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
name: Test Package
on: [ push ]
jobs:
build_1:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
python-version: [ '3.8', '3.9', '3.10', '3.11', '3.12' ]
env:
SAMNTDIR: ${{ github.workspace }}/../SAM
NREL_API_KEY: ${{ secrets.NREL_API_KEY }}
NREL_API_EMAIL: ${{ secrets.NREL_API_EMAIL }}
name: ${{ matrix.os }} ${{ matrix.python-version }}
steps:
- uses: actions/checkout@v3
- name: Setup conda
uses: s-weigand/setup-conda@v1
with:
update-conda: true
python-version: ${{ matrix.python-version }}
conda-channels: anaconda, conda-forge
- run: conda --version
- run: which python
- name: Checkout Repo
uses: actions/checkout@v3
- name: Get PySAM Version Unix
if: ${{ matrix.os != 'windows-latest' }}
run: |
VER=$(python -c "from files.version import __version__; print(__version__)")
echo "VERSION=$VER" >> $GITHUB_ENV
- name: Get PySAM Version Windows
if: ${{ matrix.os == 'windows-latest'}}
run: |
$VER=$(python -c "from files.version import __version__; print(__version__)")
echo "VERSION=$VER" >> $env:GITHUB_ENV
- name: Install NREL-PySAM
run: |
pip install -r requirements.txt
pip install -r tests/requirements.txt
conda install -c nrel nrel-pysam==${{ env.VERSION }}
- uses: actions/checkout@v3
- name: Checkout SAM
run: |
cd ..
git config --global url.https://github.com/.insteadOf git://github.com/
git clone https://github.com/NREL/SAM.git
- name: Unit tests
run: |
pytest tests/test_pysam_all.py
build_2:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-14]
python-version: [ '3.8', '3.9', '3.10', '3.11', '3.12' ]
env:
SAMNTDIR: ${{ github.workspace }}/../SAM
NREL_API_KEY: ${{ secrets.NREL_API_KEY }}
NREL_API_EMAIL: ${{ secrets.NREL_API_EMAIL }}
name: ${{ matrix.os }} ${{ matrix.python-version }}
steps:
- name: Install conda Mac arm64
run: |
mkdir -p ~/miniconda3
curl https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-arm64.sh -o ~/miniconda3/miniconda.sh
bash ~/miniconda3/miniconda.sh -b -u -p ~/miniconda3
rm -rf ~/miniconda3/miniconda.sh
~/miniconda3/bin/conda init bash
source /Users/runner/.bash_profile
conda --version
yes | conda create --name pysam_env python=${{ matrix.python-version }}
conda activate pysam_env
which python
- name: Checkout Repo
uses: actions/checkout@v3
- name: Install NREL-PySAM
run: |
source /Users/runner/.bash_profile
conda activate pysam_env
VER=$(python -c "from files.version import __version__; print(__version__)")
echo $VER
pip install -r requirements.txt
pip install -r tests/requirements.txt
conda install -c nrel nrel-pysam==$VER
- uses: actions/checkout@v3
- name: Checkout SAM
run: |
cd ..
git config --global url.https://github.com/.insteadOf git://github.com/
git clone https://github.com/NREL/SAM.git
- name: Unit tests
run: |
source /Users/runner/.bash_profile
conda activate pysam_env
pytest tests
build_3:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-14-large]
python-version: [ '3.8', '3.9', '3.10', '3.11', '3.12' ]
env:
SAMNTDIR: ${{ github.workspace }}/../SAM
NREL_API_KEY: ${{ secrets.NREL_API_KEY }}
NREL_API_EMAIL: ${{ secrets.NREL_API_EMAIL }}
name: ${{ matrix.os }} ${{ matrix.python-version }}
steps:
- name: Install conda Mac Intel
run: |
mkdir -p ~/miniconda3
curl https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-x86_64.sh -o ~/miniconda3/miniconda.sh
bash ~/miniconda3/miniconda.sh -b -u -p ~/miniconda3
rm -rf ~/miniconda3/miniconda.sh
~/miniconda3/bin/conda init bash
source /Users/runner/.bash_profile
conda --version
yes | conda create --name pysam_env python=${{ matrix.python-version }}
conda activate pysam_env
which python
- name: Checkout Repo
uses: actions/checkout@v3
- name: Install NREL-PySAM
run: |
source /Users/runner/.bash_profile
conda activate pysam_env
VER=$(python -c "from files.version import __version__; print(__version__)")
echo $VER
pip install -r requirements.txt
pip install -r tests/requirements.txt
conda install -c nrel nrel-pysam==$VER
- uses: actions/checkout@v3
- name: Checkout SAM
run: |
cd ..
git config --global url.https://github.com/.insteadOf git://github.com/
git clone https://github.com/NREL/SAM.git
- name: Unit tests
run: |
source /Users/runner/.bash_profile
conda activate pysam_env
pytest tests