change default name to hash #25
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: Tests | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| cache: "pip" | |
| - name: Install dependencies | |
| run: pip install -r requirements.txt | |
| - name: Run tests | |
| run: | | |
| # Run behave with JUnit output to verify results | |
| # Workaround for Python/behave segfault after tests complete | |
| # See: https://github.com/orgs/community/discussions/52715 | |
| set +e | |
| behave --format progress --no-capture --junit --junit-directory=test-results | |
| exit_code=$? | |
| set -e | |
| # Check if JUnit results show all tests passed | |
| if [ -d test-results ]; then | |
| failures=$(grep -l 'failures="[1-9]' test-results/*.xml 2>/dev/null | wc -l || echo "0") | |
| errors=$(grep -l 'errors="[1-9]' test-results/*.xml 2>/dev/null | wc -l || echo "0") | |
| if [ "$failures" -eq 0 ] && [ "$errors" -eq 0 ]; then | |
| echo "All tests passed according to JUnit results" | |
| if [ $exit_code -eq 139 ]; then | |
| echo "::warning::Behave crashed with segfault after tests completed (known Python issue)" | |
| fi | |
| exit 0 | |
| fi | |
| fi | |
| exit $exit_code |