Bugfix #489
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: CI | |
| on: | |
| push: | |
| # Cancel in-progress jobs when a new commit is pushed to the PR | |
| # This avoids CI jobs "stacking up" for the same PR | |
| # This won't stop existing job if new commit is pushed with [ci skip]. | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| OS_VERSION: "3.11.0" | |
| OS_SHA: 241b8abb4d | |
| jobs: | |
| test: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, windows-latest] | |
| python-version: ["3.12", "3.13"] | |
| runs-on: ${{ matrix.os }} | |
| permissions: write-all | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v8.0.0 | |
| - name: Install the package & dependencies | |
| run: | | |
| uv version | |
| uv sync | |
| - name: Lint & format | |
| run: uv run pre-commit run --all-files | |
| - name: Install OpenStudio on Linux | |
| if: runner.os == 'Linux' | |
| run: | | |
| wget -q -O OpenStudio.deb https://github.com/NatLabRockies/OpenStudio/releases/download/v${OS_VERSION}/OpenStudio-${OS_VERSION}+${OS_SHA}-Ubuntu-24.04-x86_64.deb | |
| sudo dpkg -i OpenStudio.deb | |
| rm OpenStudio.deb | |
| - name: Install OpenStudio on Windows | |
| if: runner.os == 'Windows' | |
| shell: pwsh | |
| run: | | |
| # Download the tarball in the runner temp directory | |
| $DownloadPath = Join-Path $env:RUNNER_TEMP "Windows.tar.gz" | |
| Invoke-WebRequest -OutFile $DownloadPath -URI "https://github.com/NatLabRockies/OpenStudio/releases/download/v${env:OS_VERSION}/OpenStudio-${env:OS_VERSION}+${env:OS_SHA}-Windows.tar.gz" | |
| # Extract the tarball in the runner temp directory | |
| $ExtractPath = Join-Path $env:RUNNER_TEMP "OpenStudio-${env:OS_VERSION}+${env:OS_SHA}-Windows" | |
| tar -xzf $DownloadPath -C $env:RUNNER_TEMP | |
| # Add the bin directory to PATH | |
| $OpenStudioBinPath = Join-Path $ExtractPath "bin" | |
| echo $OpenStudioBinPath >> $env:GITHUB_PATH | |
| - name: Download Weather | |
| run: uv run openstudio-hpxml-calibration download-weather | |
| - name: Measure unit tests | |
| run: | | |
| cd src/measures/ModifyXML/tests | |
| openstudio modify_xml_test.rb | |
| - name: Unit tests | |
| run: uv run pytest -v | |
| - name: Save test results | |
| uses: actions/upload-artifact@v7 | |
| if: ${{ runner.os == 'Linux' && matrix.python-version == '3.13' }} | |
| with: | |
| name: test_results | |
| path: tests/results/* | |
| calibrate: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| job_num: [0, 1, 2, 3] | |
| runs-on: ubuntu-latest | |
| needs: [test] | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.13" | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v8.0.0 | |
| - name: Install the package & dependencies | |
| run: | | |
| uv version | |
| uv sync | |
| - name: Install OpenStudio on Linux | |
| run: | | |
| wget -q -O OpenStudio.deb https://github.com/NatLabRockies/OpenStudio/releases/download/v${OS_VERSION}/OpenStudio-${OS_VERSION}+${OS_SHA}-Ubuntu-24.04-x86_64.deb | |
| sudo dpkg -i OpenStudio.deb | |
| rm OpenStudio.deb | |
| - name: Download Weather | |
| run: uv run openstudio-hpxml-calibration download-weather | |
| - name: Run calibrations | |
| run: python3 utils/run_ci_simulations.py ${{ matrix.job_num }} | |
| - name: Save calibration results | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: calibration_results_${{ matrix.job_num }} | |
| path: tests/all_calibration_results/* | |
| merge: | |
| runs-on: ubuntu-latest | |
| needs: calibrate | |
| steps: | |
| - name: Merge Artifacts | |
| uses: actions/upload-artifact/merge@v4 | |
| with: | |
| name: calibration_results | |
| pattern: calibration_results_* | |
| delete-merged: true |