integration.yaml 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  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. - uses: actions/setup-python@v2
  23. with:
  24. python-version: ${{ matrix.python-version }}
  25. - name: Cache pip dir
  26. uses: actions/cache@v2
  27. with:
  28. path: ~/.cache/pip
  29. key: pip-cache-${{ matrix.python-version }}-lint
  30. - name: Install required packages
  31. run: pip install tox
  32. - name: Run tox
  33. run: tox -e lint
  34. integration:
  35. # Name the Job
  36. name: Run mock integration tests
  37. needs: lint
  38. # Set the type of machine to run on
  39. runs-on: ubuntu-latest
  40. strategy:
  41. fail-fast: false
  42. matrix:
  43. python-version: ['3.8']
  44. cloud-provider: ['aws', 'azure', 'gcp', 'mock', 'openstack']
  45. steps:
  46. - name: Checkout code
  47. uses: actions/checkout@v2
  48. - uses: actions/setup-python@v2
  49. with:
  50. python-version: ${{ matrix.python-version }}
  51. - name: Cache pip dir
  52. uses: actions/cache@v2
  53. with:
  54. path: ~/.cache/pip
  55. key: pip-cache-${{ matrix.python-version }}-${{ hashFiles('**/setup.py', '**/requirements.txt') }}
  56. - name: Install required packages
  57. run: pip install tox
  58. - name: Run tox
  59. run: tox -e py${{ matrix.python-version }}-${{ matrix.cloud-provider }}
  60. env:
  61. PYTHONUNBUFFERED: "True"
  62. # aws
  63. AWS_ACCESS_KEY: ${{ secrets.AWS_ACCESS_KEY }}
  64. AWS_SECRET_KEY: ${{ secrets.AWS_SECRET_KEY }}
  65. # azure
  66. AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
  67. AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
  68. AZURE_SECRET: ${{ secrets.AZURE_SECRET }}
  69. AZURE_TENANT: ${{ secrets.AZURE_TENANT }}
  70. AZURE_RESOURCE_GROUP: ${{ secrets.AZURE_RESOURCE_GROUP }}
  71. AZURE_STORAGE_ACCOUNT: ${{ secrets.AZURE_STORAGE_ACCOUNT }}
  72. CB_IMAGE_AZURE: ${{ secrets.CB_IMAGE_AZURE }}
  73. CB_VM_TYPE_AZURE: ${{ secrets.CB_VM_TYPE_AZURE }}
  74. # gcp
  75. GCP_SERVICE_CREDS_DICT: ${{ secrets.GCP_SERVICE_CREDS_DICT }}
  76. CB_IMAGE_GCP: ${{ secrets.CB_IMAGE_GCP }}
  77. # openstack
  78. OS_AUTH_URL: ${{ secrets.OS_AUTH_URL }}
  79. OS_PASSWORD: ${{ secrets.OS_PASSWORD }}
  80. OS_PROJECT_NAME: ${{ secrets.OS_PROJECT_NAME }}
  81. OS_PROJECT_DOMAIN_NAME: ${{ secrets.OS_PROJECT_DOMAIN_NAME }}
  82. OS_TENANT_NAME: ${{ secrets.OS_TENANT_NAME }}
  83. OS_USERNAME: ${{ secrets.OS_USERNAME }}
  84. OS_REGION_NAME: ${{ secrets.OS_REGION_NAME }}
  85. OS_USER_DOMAIN_NAME: ${{ secrets.OS_USER_DOMAIN_NAME }}
  86. CB_IMAGE_OS: ${{ secrets.CB_IMAGE_OS }}
  87. CB_PLACEMENT_OS: ${{ secrets.CB_PLACEMENT_OS }}
  88. - name: Coveralls
  89. uses: coverallsapp/github-action@master
  90. with:
  91. github-token: ${{ secrets.GITHUB_TOKEN }}
  92. flag-name: run-${{ matrix.python-version }}-${{ matrix.cloud-provider }}
  93. parallel: true
  94. finish:
  95. needs: integration
  96. runs-on: ubuntu-latest
  97. steps:
  98. - name: Coveralls Finished
  99. uses: coverallsapp/github-action@master
  100. with:
  101. github-token: ${{ secrets.github_token }}
  102. parallel-finished: true