unittest.yml 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. name: Unittest
  2. on:
  3. pull_request:
  4. types:
  5. - opened
  6. - synchronize
  7. push:
  8. branches:
  9. - 'main'
  10. jobs:
  11. build:
  12. name: Build unittest
  13. runs-on: ubuntu-latest
  14. steps:
  15. - uses: actions/checkout@v4
  16. - name: Set up Python 3.8
  17. uses: actions/setup-python@v4
  18. with:
  19. python-version: "3.8"
  20. cache: 'pip'
  21. - name: Install min requirements
  22. run: pip install -r requirements-min.txt
  23. - name: Run tests
  24. run: python -m etc.unittest
  25. - name: Set up Python 3.12
  26. uses: actions/setup-python@v4
  27. with:
  28. python-version: "3.12"
  29. cache: 'pip'
  30. - name: Install requirements
  31. run: |
  32. pip install -r requirements.txt
  33. pip uninstall -y nodriver
  34. - name: Run tests
  35. run: python -m etc.unittest
  36. - name: Save PR number
  37. env:
  38. PR_NUMBER: ${{ github.event.number }}
  39. run: |
  40. mkdir -p ./pr
  41. echo $PR_NUMBER > ./pr/pr_number
  42. - uses: actions/upload-artifact@v4
  43. with:
  44. name: pr_number
  45. path: pr/