RCT/JDJ/residential associated zones #6909
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
| # This workflow will check formatting with Black, install Python dependencies, | |
| # and run tests with pytest | |
| # For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | |
| # Apply this workflow when creating a pull request or pushing a commit to a PR | |
| on: pull_request | |
| jobs: | |
| black-formatting-check: | |
| name: Black formatting check | |
| runs-on: 'ubuntu-latest' | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| - name: Setup Python | |
| uses: actions/setup-python@v4 | |
| # This will halt the action if formatting fails | |
| # Note: This will also fail if there are syntax errors | |
| - uses: psf/black@stable | |
| with: | |
| version: "22.6.0" | |
| detect-changes: | |
| name: Detect changed rulesets | |
| runs-on: ubuntu-latest | |
| outputs: | |
| ashrae9012019: ${{ steps.filter.outputs.ashrae9012019 }} | |
| ashrae9012022: ${{ steps.filter.outputs.ashrae9012022 }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| - name: Detect file changes | |
| id: filter | |
| uses: dorny/paths-filter@v3 | |
| with: | |
| filters: | | |
| ashrae9012019: | |
| - 'rct229/rulesets/ashrae9012019/**' | |
| - 'rct229/ruletest_engine/ruletest_jsons/ashrae9012019/**' | |
| ashrae9012022: | |
| - 'rct229/rulesets/ashrae9012022/**' | |
| - 'rct229/ruletest_engine/ruletest_jsons/ashrae9012022/**' | |
| run-unit-tests: | |
| name: Run unit tests | |
| runs-on: 'ubuntu-latest' | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| - name: Setup Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.10' | |
| - name: Install Poetry | |
| run: | | |
| curl -sSL https://install.python-poetry.org | python3 - --version 1.8.4 | |
| - name: Install venv | |
| run: poetry install | |
| - name: Run pytests | |
| run: poetry run pytest -v | |
| run-ruletests-2019: | |
| name: Run 2019 rule tests | |
| runs-on: ubuntu-latest | |
| needs: detect-changes | |
| if: needs.detect-changes.outputs.ashrae9012019 == 'true' | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| - name: Setup Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.10' | |
| - name: Install Poetry | |
| run: | | |
| curl -sSL https://install.python-poetry.org | python3 - --version 1.8.4 | |
| - name: Install dependencies | |
| run: poetry install | |
| - name: Run rule tests for 90.1-2019 | |
| run: poetry run rct229 test -rs ashrae9012019 | |
| run-ruletests-2022: | |
| name: Run 2022 rule tests | |
| runs-on: ubuntu-latest | |
| needs: detect-changes | |
| if: needs.detect-changes.outputs.ashrae9012022 == 'true' | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| - name: Setup Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.10' | |
| - name: Install Poetry | |
| run: | | |
| curl -sSL https://install.python-poetry.org | python3 - --version 1.8.4 | |
| - name: Install dependencies | |
| run: poetry install | |
| - name: Run rule tests for 90.1-2022 | |
| run: poetry run rct229 test -rs ashrae9012022 |