Only add measure.xml files #43
Workflow file for this run
This file contains 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
on: | |
push: | |
branches: [ '*' ] | |
jobs: | |
run-python-unit-tests: | |
name: Run python unit tests | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and run unit test Dockerfile | |
uses: ./.github/actions/unit-test-action | |
- name: Upload Build Artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: test_results | |
path: ${{ github.workspace }}/test_results | |
# - name: Check for changes in measure_check_output.txt | |
# run: | | |
# if grep -q "Changes detected" test_results/measure_check_output.txt; then | |
# echo "Measure XML update required. Run 'openstudio measure -t ./lib/measures'" | |
# exit 1 | |
# fi | |
- name: Commit and push changes | |
if: ${{ always() }} # Ensure this runs even if the previous steps modify files | |
run: | | |
git config user.name "GitHub Actions Bot" | |
git config user.email "[email protected]" | |
git add **/measure.xml | |
if git diff --cached --quiet; then | |
echo "No changes to measure.xml files. Skipping commit." | |
else | |
git commit -m "Auto-update measure.xml files by GitHub Actions" | |
git push origin HEAD | |
fi |