-
Notifications
You must be signed in to change notification settings - Fork 14
127 lines (127 loc) · 4.84 KB
/
ci.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
name: BuildStockBatch Tests
on:
push:
branches:
- develop
pull_request:
types:
- synchronize
- opened
jobs:
full_tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ['3.11', '3.12']
name: Tests - Python ${{ matrix.python-version }}
steps:
- uses: actions/checkout@v4
with:
path: buildstockbatch
- uses: actions/checkout@v4
with:
repository: NREL/resstock
path: resstock
ref: develop
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Download weather
run: |
mkdir weather
cd weather
wget --quiet https://data.nrel.gov/system/files/156/BuildStock_TMY3_FIPS.zip
- name: Download and Install OpenStudio
run: |
sudo snap install yq
export OS_VER=`yq '.os_version' resstock/project_national/national_baseline.yml`
export OS_SHA=`yq '.os_sha' resstock/project_national/national_baseline.yml`
export OS_INSTALLER_FILENAME="OpenStudio-${OS_VER}+${OS_SHA}-Ubuntu-22.04-x86_64.deb"
wget -q "https://github.com/NREL/OpenStudio/releases/download/v${OS_VER}/${OS_INSTALLER_FILENAME}"
sudo apt install -y "./${OS_INSTALLER_FILENAME}"
openstudio openstudio_version
which openstudio
- name: Install buildstockbatch
run: |
cd buildstockbatch
python -m pip install --progress-bar off --upgrade pip
pip install .[dev,aws] --progress-bar off
- name: Black
uses: psf/black@stable
with:
src: "./buildstockbatch"
- name: Run PyTest and Coverage
run: |
cd buildstockbatch
pytest -vv --junitxml=coverage/junit.xml --cov=buildstockbatch --cov-report=xml:coverage/coverage.xml --cov-report=html:coverage/htmlreport
- name: Test Report
uses: mikepenz/action-junit-report@v3.5.2
if: ${{ matrix.python-version == '3.11' }}
with:
report_paths: buildstockbatch/coverage/junit.xml
check_name: Testing Report
fail_on_failure: true
- name: Save Coverage Report
uses: actions/upload-artifact@v4
if: ${{ matrix.python-version == '3.11' }}
with:
name: coverage-report-html
path: buildstockbatch/coverage/htmlreport/
- name: Save Coverage Report XML
uses: actions/upload-artifact@v4
if: ${{ matrix.python-version == '3.11' }}
with:
name: coverage-report-xml
path: buildstockbatch/coverage/coverage.xml
- name: Build documentation
if: ${{ matrix.python-version == '3.11' }}
run: |
cd buildstockbatch/docs
make html SPHINXOPTS="-W --keep-going -n"
- name: Save Docs
uses: actions/upload-artifact@v4
if: ${{ matrix.python-version == '3.11' }}
with:
name: documentation
path: buildstockbatch/docs/_build/html/
pip_install_test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v4
with:
repository: NREL/resstock
path: resstock
ref: develop
- uses: actions/setup-python@v5
with:
python-version: 3.11
- name: Download weather
run: |
mkdir weather
cd weather
wget --quiet https://data.nrel.gov/system/files/156/BuildStock_TMY3_FIPS.zip
- name: Download and Install OpenStudio
run: |
sudo snap install yq
export OS_VER=`yq '.os_version' resstock/project_national/national_baseline.yml`
export OS_SHA=`yq '.os_sha' resstock/project_national/national_baseline.yml`
export OS_INSTALLER_FILENAME="OpenStudio-${OS_VER}+${OS_SHA}-Ubuntu-22.04-x86_64.deb"
wget -q "https://github.com/NREL/OpenStudio/releases/download/v${OS_VER}/${OS_INSTALLER_FILENAME}"
sudo apt install -y "./${OS_INSTALLER_FILENAME}"
openstudio openstudio_version
which openstudio
- name: Install buildstockbatch
run: |
python -m pip install --progress-bar off --upgrade pip
pip install git+https://github.com/NREL/buildstockbatch.git@${{ github.head_ref || github.ref_name }}
- name: Run local validation of project national yml
run: buildstock_local --validateonly resstock/project_national/national_baseline.yml
- name: Validate upgrades
run: buildstock_local --validateonly resstock/project_national/national_upgrades.yml
- name: Validate testing projects
run: buildstock_local --validateonly resstock/project_testing/testing_baseline.yml
- name: Validate testing upgrades
run: buildstock_local --validateonly resstock/project_testing/testing_upgrades.yml