Pyradiance integration #1246
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 v6.0 | |
| 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 }} | |