-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
24 additions
and
19 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,26 +10,34 @@ jobs: | |
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: Build Docker image | ||
# run: | | ||
# docker build -t python_measure_test . | ||
# docker run --rm python_measure_test | ||
|
||
- name: Check for FAILURE in pytest_output.txt | ||
run: | | ||
cat test_results/pytest_output.txt | ||
cat test_results/measure_check_output.txt | ||
# cat test_results/pytest_output.txt | ||
# if grep -q 'FAILURE' test_results/pytest_output.txt; then | ||
# exit 1 | ||
# fi | ||
- name: Upload Build Artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: test_results | ||
path: ${{ github.workspace }}/test_results | ||
path: ${{ github.workspace }}/test_results | ||
|
||
- name: Check test results | ||
run: | | ||
cat test_results/pytest_output.txt | ||
if grep -q "FAILURES" test_results/pytest_output.txt; then | ||
exit 1 | ||
fi | ||
- name: Update measure.xmls | ||
run: | | ||
cat test_results/measure_check_output.txt | ||
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 |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,9 @@ | ||
#!/usr/bin/env bash | ||
|
||
echo $GITHUB_WORKSPACE | ||
|
||
mkdir $GITHUB_WORKSPACE/test_results | ||
|
||
openstudio measure -t ./lib/measures >> $GITHUB_WORKSPACE/test_results/measure_check_output.txt | ||
|
||
for dir in $(find . -type f -name 'measure.py' -exec dirname {} \; | sort -u); do | ||
pytest "$dir" >> "$GITHUB_WORKSPACE/test_results/pytest_output.txt" | ||
pytest $dir >> $GITHUB_WORKSPACE/test_results/pytest_output.txt | ||
done |