test.yml 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. name: Test
  2. on: [push, pull_request, workflow_dispatch]
  3. jobs:
  4. test:
  5. runs-on: ubuntu-latest
  6. strategy:
  7. matrix:
  8. python-version: ['2.7', '3.5', '3.6', '3.7', '3.8', '3.9', '3.10']
  9. env:
  10. cache-revision: 2
  11. steps:
  12. - uses: actions/checkout@v3
  13. - name: Set up Python ${{ matrix.python-version }}
  14. uses: actions/setup-python@v4
  15. with:
  16. python-version: ${{ matrix.python-version }}
  17. cache: 'pip'
  18. - name: Install dependencies
  19. run: |
  20. python -m pip install --upgrade pip
  21. pip install -r requirements.txt
  22. pip install .
  23. - name: Cache minio
  24. id: cache-minio
  25. uses: actions/cache@v3
  26. env:
  27. cache-name: cache-minio
  28. with:
  29. path: ~/cache
  30. key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.cache-revision }}
  31. - name: Download minio on cache miss
  32. if: steps.cache-minio.outputs.cache-hit != 'true'
  33. run: |
  34. mkdir -p ~/cache
  35. test ! -e ~/cache/minio && wget -O ~/cache/minio https://dl.minio.io/server/minio/release/linux-amd64/minio || echo "Minio already in cache"
  36. - name: Start a local instance of minio
  37. run: |
  38. export MINIO_ROOT_USER=Q3AM3UQ867SPQQA43P2F
  39. export MINIO_ROOT_PASSWORD=zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG
  40. export export MINIO_BROWSER=off
  41. chmod +x ~/cache/minio
  42. mkdir -p ~/minio_tmp
  43. ~/cache/minio server ~/minio_tmp &
  44. sleep 4 # give minio some time to start
  45. - name: Run tests
  46. run: python ./run-tests.py -c .ci.s3cfg -p baseauto -s minio
  47. - name: Terminate
  48. if: always()
  49. continue-on-error: true
  50. run: killall minio