-
Notifications
You must be signed in to change notification settings - Fork 56
90 lines (76 loc) · 3.63 KB
/
Copy pathpytest.yaml
File metadata and controls
90 lines (76 loc) · 3.63 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
name: test
on: [pull_request, push]
# Force all JavaScript actions to use Node 24 to silence the v4/v5 warnings
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
jobs:
pytest:
runs-on: ubuntu-latest
strategy:
fail-fast: false # don't cancel other matrix jobs when one fails
matrix:
python-version: ["3.10", "3.12"]
# Test two environments:
# 1) dependencies with pinned versions from requirements.txt
# 2) 'pip install --upgrade --upgrade-strategy=eager .' to install upgraded
# dependencies from PyPi using version ranges defined within setup.py
env: [
'-r requirements.txt .[all]'
]
include:
- python-version: "3.13"
env: '--upgrade --upgrade-strategy=eager .[all]'
- python-version: "3.14"
env: '--upgrade --upgrade-strategy=eager .[all]'
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install Radiance v5.3
run: |
#wget https://github.com/LBNL-ETA/Radiance/releases/download/012cb178/Radiance_012cb178_Linux.zip -O radiance.zip
wget https://github.com/LBNL-ETA/Radiance/releases/download/rad6R0P2/Radiance_c1700d56_Linux.zip -O radiance.zip
unzip radiance.zip
#tar -xvf radiance-5.3.012cb17835-Linux.tar.gz
tar -xvf radiance-6.0.c1700d56cc-Linux.tar.gz
ls -l $PWD
- name: Copy gencumulativesky into radiance /bin
run: |
cp $PWD/bifacial_radiance/data/gencumulativesky $PWD/radiance-6.0.c1700d56cc-Linux/usr/local/radiance/bin/
- name: Install SMARTS 2.9.5
run: |
wget 'https://www.nlr.gov/media/docs/libraries/grid/smarts-295-linux-tar.gz?sfvrsn=ef08b59d_1&download=true' -O /tmp/smarts.tar.gz
#wget https://www.nlr.gov/grid/solar-resource/assets/data/smarts-295-linux-tar.gz -O /tmp/smarts.tar.gz
tar -xvf /tmp/smarts.tar.gz
unlink $PWD/SMARTS_295_Linux/smarts295bat
sed -i 's/batch=.FALSE./batch=.TRUE./g' $PWD/SMARTS_295_Linux/Source_code/smarts295.f
sudo apt-get install gfortran
gfortran -o $PWD/SMARTS_295_Linux/smarts295bat $PWD/SMARTS_295_Linux/Source_code/smarts295.f
ls -l $PWD/SMARTS_295_Linux/
- name: Install ${{ matrix.env }}
run: |
pip install ${{ matrix.env }}
pip install coveralls wheel
- name: Set environment variables
run: |
# https://docs.github.com/en/actions/learn-github-actions/workflow-commands-for-github-actions#adding-a-system-path
echo "/home/runner/work/bifacial_radiance/bifacial_radiance/radiance-6.0.c1700d56cc-Linux/usr/local/radiance/bin" >> $GITHUB_PATH
echo "/home/runner/work/bifacial_radiance/bifacial_radiance/SMARTS_295_Linux" >> $GITHUB_PATH
- name: Install xvfb
run: sudo apt-get update && sudo apt-get install -y xvfb
- name: Test with pytest ${{ matrix.env }}
run: |
xvfb-run -a coverage run -m pytest
coverage report
env: # environment variables available to this step
RAYPATH: .:/home/runner/work/bifacial_radiance/bifacial_radiance/radiance-6.0.c1700d56cc-Linux/usr/local/radiance/lib
SMARTSPATH: /home/runner/work/bifacial_radiance/bifacial_radiance/SMARTS_295_Linux
- name: Coveralls
continue-on-error: true #prevent coveralls from blowing the test report
if: matrix.python-version == 3.11 # && ${{ matrix.env }} == '-r requirements.txt .[all]'
run: |
coveralls --service=github
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}