integration.yaml 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. name: Integration
  2. # Run this workflow every time a new commit pushed to your repository
  3. on:
  4. push:
  5. branches:
  6. - master
  7. pull_request:
  8. branches:
  9. - master
  10. jobs:
  11. # Set the job key. The key is displayed as the job name
  12. # when a job name is not provided
  13. lint:
  14. name: Lint code
  15. runs-on: ubuntu-latest
  16. strategy:
  17. matrix:
  18. python-version: [ '3.8' ]
  19. steps:
  20. - name: Checkout code
  21. uses: actions/checkout@v2
  22. - name: Setup Python
  23. uses: actions/setup-python@v2
  24. with:
  25. python-version: ${{ matrix.python-version }}
  26. - name: Cache pip dir
  27. uses: actions/cache@v2
  28. with:
  29. path: ~/.cache/pip
  30. key: pip-cache-${{ matrix.python-version }}-lint
  31. - name: Install required packages
  32. run: pip install tox
  33. - name: Run tox
  34. run: tox -e lint
  35. integration:
  36. # Name the Job
  37. name: Per-cloud integration tests
  38. needs: lint
  39. # Set the type of machine to run on
  40. runs-on: ubuntu-latest
  41. strategy:
  42. fail-fast: false
  43. matrix:
  44. python-version: ['3.8']
  45. cloud-provider: ['aws', 'azure', 'gcp', 'mock', 'openstack']
  46. steps:
  47. - name: Checkout code
  48. uses: actions/checkout@v2
  49. - name: Setup Python
  50. uses: actions/setup-python@v2
  51. with:
  52. python-version: ${{ matrix.python-version }}
  53. - name: Cache pip dir
  54. uses: actions/cache@v2
  55. with:
  56. path: ~/.cache/pip
  57. key: pip-cache-${{ matrix.python-version }}-${{ hashFiles('**/setup.py', '**/requirements.txt') }}
  58. - name: Install required packages
  59. run: pip install tox
  60. - name: Run tox
  61. run: tox -e py${{ matrix.python-version }}-${{ matrix.cloud-provider }}
  62. env:
  63. PYTHONUNBUFFERED: "True"
  64. # aws
  65. AWS_ACCESS_KEY: ${{ secrets.AWS_ACCESS_KEY }}
  66. AWS_SECRET_KEY: ${{ secrets.AWS_SECRET_KEY }}
  67. # azure
  68. AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
  69. AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
  70. AZURE_SECRET: ${{ secrets.AZURE_SECRET }}
  71. AZURE_TENANT: ${{ secrets.AZURE_TENANT }}
  72. AZURE_RESOURCE_GROUP: ${{ secrets.AZURE_RESOURCE_GROUP }}
  73. AZURE_STORAGE_ACCOUNT: ${{ secrets.AZURE_STORAGE_ACCOUNT }}
  74. CB_IMAGE_AZURE: ${{ secrets.CB_IMAGE_AZURE }}
  75. CB_VM_TYPE_AZURE: ${{ secrets.CB_VM_TYPE_AZURE }}
  76. # gcp
  77. GCP_SERVICE_CREDS_DICT: ${{ secrets.GCP_SERVICE_CREDS_DICT }}
  78. CB_IMAGE_GCP: ${{ secrets.CB_IMAGE_GCP }}
  79. # openstack
  80. OS_AUTH_URL: ${{ secrets.OS_AUTH_URL }}
  81. OS_PASSWORD: ${{ secrets.OS_PASSWORD }}
  82. OS_PROJECT_NAME: ${{ secrets.OS_PROJECT_NAME }}
  83. OS_PROJECT_DOMAIN_NAME: ${{ secrets.OS_PROJECT_DOMAIN_NAME }}
  84. OS_TENANT_NAME: ${{ secrets.OS_TENANT_NAME }}
  85. OS_USERNAME: ${{ secrets.OS_USERNAME }}
  86. OS_REGION_NAME: ${{ secrets.OS_REGION_NAME }}
  87. OS_USER_DOMAIN_NAME: ${{ secrets.OS_USER_DOMAIN_NAME }}
  88. CB_IMAGE_OS: ${{ secrets.CB_IMAGE_OS }}
  89. CB_PLACEMENT_OS: ${{ secrets.CB_PLACEMENT_OS }}
  90. - name: Coveralls
  91. uses: coverallsapp/github-action@master
  92. with:
  93. github-token: ${{ secrets.GITHUB_TOKEN }}
  94. flag-name: run-${{ matrix.python-version }}-${{ matrix.cloud-provider }}
  95. parallel: true
  96. finish:
  97. needs: integration
  98. runs-on: ubuntu-latest
  99. steps:
  100. - name: Coveralls Finished
  101. uses: coverallsapp/github-action@master
  102. with:
  103. github-token: ${{ secrets.github_token }}
  104. parallel-finished: true