unittest.yml 1015 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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: pip install -r requirements.txt
  32. - name: Run tests
  33. run: python -m etc.unittest
  34. - name: Save PR number
  35. env:
  36. PR_NUMBER: ${{ github.event.number }}
  37. run: |
  38. mkdir -p ./pr
  39. echo $PR_NUMBER > ./pr/pr_number
  40. - uses: actions/upload-artifact@v4
  41. with:
  42. name: pr_number
  43. path: pr/