run-tests.yml 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. name: Tests
  2. on:
  3. push:
  4. paths-ignore:
  5. - "*.md"
  6. branches-ignore:
  7. - master
  8. workflow_call:
  9. jobs:
  10. test:
  11. runs-on: ubuntu-latest
  12. strategy:
  13. matrix:
  14. nim:
  15. - "1.6.10"
  16. - "1.6.x"
  17. - "2.0.x"
  18. steps:
  19. - uses: actions/checkout@v3
  20. with:
  21. fetch-depth: 0
  22. - name: Cache nimble
  23. id: cache-nimble
  24. uses: actions/cache@v3
  25. with:
  26. path: ~/.nimble
  27. key: nimble-${{ hashFiles('*.nimble') }}
  28. restore-keys: "nimble-"
  29. - uses: actions/setup-python@v4
  30. with:
  31. python-version: "3.10"
  32. cache: "pip"
  33. - uses: jiro4989/setup-nim-action@v1
  34. with:
  35. nim-version: ${{ matrix.nim }}
  36. repo-token: ${{ secrets.GITHUB_TOKEN }}
  37. - run: nimble build -d:release -Y
  38. - run: pip install seleniumbase
  39. - run: seleniumbase install chromedriver
  40. - uses: supercharge/redis-github-action@1.5.0
  41. - name: Prepare Nitter
  42. run: |
  43. sudo apt install libsass-dev -y
  44. cp nitter.example.conf nitter.conf
  45. nimble md
  46. nimble scss
  47. - name: Run tests
  48. env:
  49. GUEST_ACCOUNTS: ${{ secrets.GUEST_ACCOUNTS }}
  50. run: |
  51. echo $GUEST_ACCOUNTS > ./guest_accounts.jsonl
  52. ./nitter &
  53. pytest -n4 tests