Quellcode durchsuchen

Use individual workflows for tests and update readme links

Nuwan Goonasekera vor 4 Jahren
Ursprung
Commit
d881ccc5c3

+ 55 - 0
.github/workflows/aws.yaml

@@ -0,0 +1,55 @@
+name: aws
+
+# Run this workflow every time the lint workflow successfully completes
+on:
+  workflow_run:
+    workflows: ["lint"]
+    types:
+      - completed
+
+jobs:
+  # Set the job key. The key is displayed as the job name
+  # when a job name is not provided
+  aws:
+    # Run only if lint step succeeded
+    if: ${{ github.event.workflow_run.conclusion == 'success' }}
+    # Set the type of machine to run on
+    runs-on: ubuntu-latest
+    strategy:
+      fail-fast: false
+      matrix:
+        python-version: ['3.8']
+        cloud-provider: ['aws']
+
+    steps:
+      - name: Checkout code
+        uses: actions/checkout@v2
+
+      - name: Setup Python
+        uses: actions/setup-python@v2
+        with:
+           python-version: ${{ matrix.python-version }}
+
+      - name: Cache pip dir
+        uses: actions/cache@v2
+        with:
+          path: ~/.cache/pip
+          key: pip-cache-${{ matrix.python-version }}-${{ hashFiles('**/setup.py', '**/requirements.txt') }}
+
+      - name: Install required packages
+        run: pip install tox
+
+      - name: Run tox
+        run: tox -e py${{ matrix.python-version }}-${{ matrix.cloud-provider }}
+        env:
+          PYTHONUNBUFFERED: "True"
+          # aws
+          AWS_ACCESS_KEY: ${{ secrets.AWS_ACCESS_KEY }}
+          AWS_SECRET_KEY: ${{ secrets.AWS_SECRET_KEY }}
+
+      - name: Coveralls
+        uses: AndreMiras/coveralls-python-action@develop
+        with:
+          github-token: ${{ secrets.GITHUB_TOKEN }}
+          flag-name: run-${{ matrix.python-version }}-${{ matrix.cloud-provider }}
+          parallel: true

+ 61 - 0
.github/workflows/azure.yaml

@@ -0,0 +1,61 @@
+name: azure
+
+# Run this workflow every time the lint workflow successfully completes
+on:
+  workflow_run:
+    workflows: ["lint"]
+    types:
+      - completed
+
+jobs:
+  # Set the job key. The key is displayed as the job name
+  # when a job name is not provided
+  azure:
+    # Run only if lint step succeeded
+    if: ${{ github.event.workflow_run.conclusion == 'success' }}
+    # Set the type of machine to run on
+    runs-on: ubuntu-latest
+    strategy:
+      fail-fast: false
+      matrix:
+        python-version: ['3.8']
+        cloud-provider: ['azure']
+
+    steps:
+      - name: Checkout code
+        uses: actions/checkout@v2
+
+      - name: Setup Python
+        uses: actions/setup-python@v2
+        with:
+           python-version: ${{ matrix.python-version }}
+
+      - name: Cache pip dir
+        uses: actions/cache@v2
+        with:
+          path: ~/.cache/pip
+          key: pip-cache-${{ matrix.python-version }}-${{ hashFiles('**/setup.py', '**/requirements.txt') }}
+
+      - name: Install required packages
+        run: pip install tox
+
+      - name: Run tox
+        run: tox -e py${{ matrix.python-version }}-${{ matrix.cloud-provider }}
+        env:
+          PYTHONUNBUFFERED: "True"
+          # azure
+          AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
+          AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
+          AZURE_SECRET: ${{ secrets.AZURE_SECRET }}
+          AZURE_TENANT: ${{ secrets.AZURE_TENANT }}
+          AZURE_RESOURCE_GROUP: ${{ secrets.AZURE_RESOURCE_GROUP }}
+          AZURE_STORAGE_ACCOUNT: ${{ secrets.AZURE_STORAGE_ACCOUNT }}
+          CB_IMAGE_AZURE: ${{ secrets.CB_IMAGE_AZURE }}
+          CB_VM_TYPE_AZURE: ${{ secrets.CB_VM_TYPE_AZURE }}
+
+      - name: Coveralls
+        uses: AndreMiras/coveralls-python-action@develop
+        with:
+          github-token: ${{ secrets.GITHUB_TOKEN }}
+          flag-name: run-${{ matrix.python-version }}-${{ matrix.cloud-provider }}
+          parallel: true

+ 22 - 0
.github/workflows/coverage.yaml

@@ -0,0 +1,22 @@
+name: coverage
+
+# Run this workflow at the end when all integration tests finish
+on:
+  workflow_run:
+    workflows: ["aws", "azure", "gcp", "mock", "openstack"]
+    types:
+      - completed
+
+jobs:
+  # Set the job key. The key is displayed as the job name
+  # when a job name is not provided
+  coverage:
+    # Run only if previous step succeeded
+    if: ${{ github.event.workflow_run.conclusion == 'success' }}
+    runs-on: ubuntu-latest
+    steps:
+    - name: Coveralls Finished
+      uses: AndreMiras/coveralls-python-action@develop
+      with:
+        github-token: ${{ secrets.github_token }}
+        parallel-finished: true

+ 55 - 0
.github/workflows/gcp.yaml

@@ -0,0 +1,55 @@
+name: gcp
+
+# Run this workflow every time the lint workflow successfully completes
+on:
+  workflow_run:
+    workflows: ["lint"]
+    types:
+      - completed
+
+jobs:
+  # Set the job key. The key is displayed as the job name
+  # when a job name is not provided
+  gcp:
+    # Run only if lint step succeeded
+    if: ${{ github.event.workflow_run.conclusion == 'success' }}
+    # Set the type of machine to run on
+    runs-on: ubuntu-latest
+    strategy:
+      fail-fast: false
+      matrix:
+        python-version: ['3.8']
+        cloud-provider: ['gcp']
+
+    steps:
+      - name: Checkout code
+        uses: actions/checkout@v2
+
+      - name: Setup Python
+        uses: actions/setup-python@v2
+        with:
+           python-version: ${{ matrix.python-version }}
+
+      - name: Cache pip dir
+        uses: actions/cache@v2
+        with:
+          path: ~/.cache/pip
+          key: pip-cache-${{ matrix.python-version }}-${{ hashFiles('**/setup.py', '**/requirements.txt') }}
+
+      - name: Install required packages
+        run: pip install tox
+
+      - name: Run tox
+        run: tox -e py${{ matrix.python-version }}-${{ matrix.cloud-provider }}
+        env:
+          PYTHONUNBUFFERED: "True"
+          # gcp
+          GCP_SERVICE_CREDS_DICT: ${{ secrets.GCP_SERVICE_CREDS_DICT }}
+          CB_IMAGE_GCP: ${{ secrets.CB_IMAGE_GCP }}
+
+      - name: Coveralls
+        uses: AndreMiras/coveralls-python-action@develop
+        with:
+          github-token: ${{ secrets.GITHUB_TOKEN }}
+          flag-name: run-${{ matrix.python-version }}-${{ matrix.cloud-provider }}
+          parallel: true

+ 0 - 118
.github/workflows/integration.yaml

@@ -1,118 +0,0 @@
-name: Integration tests
-
-# Run this workflow every time a new commit pushed to your repository
-on:
-  push:
-    branches:
-    - master
-  pull_request:
-    branches:
-      - master
-
-jobs:
-  # Set the job key. The key is displayed as the job name
-  # when a job name is not provided
-  lint:
-    name: Lint code
-    runs-on: ubuntu-latest
-    strategy:
-      matrix:
-        python-version: [ '3.8' ]
-    steps:
-      - name: Checkout code
-        uses: actions/checkout@v2
-
-      - name: Setup Python
-        uses: actions/setup-python@v2
-        with:
-           python-version: ${{ matrix.python-version }}
-
-      - name: Cache pip dir
-        uses: actions/cache@v2
-        with:
-          path: ~/.cache/pip
-          key: pip-cache-${{ matrix.python-version }}-lint
-
-      - name: Install required packages
-        run: pip install tox
-
-      - name: Run tox
-        run: tox -e lint
-
-  integration:
-    # Name the Job
-    name: Per-cloud integration tests
-    needs: lint
-    # Set the type of machine to run on
-    runs-on: ubuntu-latest
-    strategy:
-      fail-fast: false
-      matrix:
-        python-version: ['3.8']
-        cloud-provider: ['aws', 'azure', 'gcp', 'mock', 'openstack']
-
-    steps:
-      - name: Checkout code
-        uses: actions/checkout@v2
-
-      - name: Setup Python
-        uses: actions/setup-python@v2
-        with:
-           python-version: ${{ matrix.python-version }}
-
-      - name: Cache pip dir
-        uses: actions/cache@v2
-        with:
-          path: ~/.cache/pip
-          key: pip-cache-${{ matrix.python-version }}-${{ hashFiles('**/setup.py', '**/requirements.txt') }}
-
-      - name: Install required packages
-        run: pip install tox
-
-      - name: Run tox
-        run: tox -e py${{ matrix.python-version }}-${{ matrix.cloud-provider }}
-        env:
-          PYTHONUNBUFFERED: "True"
-          # aws
-          AWS_ACCESS_KEY: ${{ secrets.AWS_ACCESS_KEY }}
-          AWS_SECRET_KEY: ${{ secrets.AWS_SECRET_KEY }}
-          # azure
-          AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
-          AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
-          AZURE_SECRET: ${{ secrets.AZURE_SECRET }}
-          AZURE_TENANT: ${{ secrets.AZURE_TENANT }}
-          AZURE_RESOURCE_GROUP: ${{ secrets.AZURE_RESOURCE_GROUP }}
-          AZURE_STORAGE_ACCOUNT: ${{ secrets.AZURE_STORAGE_ACCOUNT }}
-          CB_IMAGE_AZURE: ${{ secrets.CB_IMAGE_AZURE }}
-          CB_VM_TYPE_AZURE: ${{ secrets.CB_VM_TYPE_AZURE }}
-          # gcp
-          GCP_SERVICE_CREDS_DICT: ${{ secrets.GCP_SERVICE_CREDS_DICT }}
-          CB_IMAGE_GCP: ${{ secrets.CB_IMAGE_GCP }}
-          # openstack
-          OS_AUTH_URL: ${{ secrets.OS_AUTH_URL }}
-          OS_PASSWORD: ${{ secrets.OS_PASSWORD }}
-          OS_PROJECT_NAME: ${{ secrets.OS_PROJECT_NAME }}
-          OS_PROJECT_DOMAIN_NAME: ${{ secrets.OS_PROJECT_DOMAIN_NAME }}
-          OS_TENANT_NAME: ${{ secrets.OS_TENANT_NAME }}
-          OS_USERNAME: ${{ secrets.OS_USERNAME }}
-          OS_REGION_NAME: ${{ secrets.OS_REGION_NAME }}
-          OS_USER_DOMAIN_NAME: ${{ secrets.OS_USER_DOMAIN_NAME }}
-          CB_IMAGE_OS: ${{ secrets.CB_IMAGE_OS }}
-          CB_PLACEMENT_OS: ${{ secrets.CB_PLACEMENT_OS }}
-
-      - name: Coveralls
-        uses: AndreMiras/coveralls-python-action@develop
-        with:
-          github-token: ${{ secrets.GITHUB_TOKEN }}
-          flag-name: run-${{ matrix.python-version }}-${{ matrix.cloud-provider }}
-          parallel: true
-
-  finish:
-    needs: integration
-    runs-on: ubuntu-latest
-    steps:
-    - name: Coveralls Finished
-      uses: AndreMiras/coveralls-python-action@develop
-      with:
-        github-token: ${{ secrets.github_token }}
-        parallel-finished: true

+ 39 - 0
.github/workflows/lint.yaml

@@ -0,0 +1,39 @@
+name: lint
+
+# Run this workflow every time a new commit pushed to your repository
+on:
+  push:
+    branches:
+    - master
+  pull_request:
+    branches:
+      - master
+
+jobs:
+  # Set the job key. The key is displayed as the job name
+  # when a job name is not provided
+  lint:
+    runs-on: ubuntu-latest
+    strategy:
+      matrix:
+        python-version: [ '3.8' ]
+    steps:
+      - name: Checkout code
+        uses: actions/checkout@v2
+
+      - name: Setup Python
+        uses: actions/setup-python@v2
+        with:
+           python-version: ${{ matrix.python-version }}
+
+      - name: Cache pip dir
+        uses: actions/cache@v2
+        with:
+          path: ~/.cache/pip
+          key: pip-cache-${{ matrix.python-version }}-lint
+
+      - name: Install required packages
+        run: pip install tox
+
+      - name: Run tox
+        run: tox -e lint

+ 55 - 0
.github/workflows/mock.yaml

@@ -0,0 +1,55 @@
+name: mock
+
+# Run this workflow every time the lint workflow successfully completes
+on:
+  workflow_run:
+    workflows: ["lint"]
+    types:
+      - completed
+
+jobs:
+  # Set the job key. The key is displayed as the job name
+  # when a job name is not provided
+  mock:
+    # Run only if lint step succeeded
+    if: ${{ github.event.workflow_run.conclusion == 'success' }}
+    # Set the type of machine to run on
+    runs-on: ubuntu-latest
+    strategy:
+      fail-fast: false
+      matrix:
+        python-version: ['3.8']
+        cloud-provider: ['mock']
+
+    steps:
+      - name: Checkout code
+        uses: actions/checkout@v2
+
+      - name: Setup Python
+        uses: actions/setup-python@v2
+        with:
+           python-version: ${{ matrix.python-version }}
+
+      - name: Cache pip dir
+        uses: actions/cache@v2
+        with:
+          path: ~/.cache/pip
+          key: pip-cache-${{ matrix.python-version }}-${{ hashFiles('**/setup.py', '**/requirements.txt') }}
+
+      - name: Install required packages
+        run: pip install tox
+
+      - name: Run tox
+        run: tox -e py${{ matrix.python-version }}-${{ matrix.cloud-provider }}
+        env:
+          PYTHONUNBUFFERED: "True"
+          # aws
+          AWS_ACCESS_KEY: DUMMY_ACCESS
+          AWS_SECRET_KEY: DUMMY_SECRET
+
+      - name: Coveralls
+        uses: AndreMiras/coveralls-python-action@develop
+        with:
+          github-token: ${{ secrets.GITHUB_TOKEN }}
+          flag-name: run-${{ matrix.python-version }}-${{ matrix.cloud-provider }}
+          parallel: true

+ 63 - 0
.github/workflows/openstack.yaml

@@ -0,0 +1,63 @@
+name: openstack
+
+# Run this workflow every time the lint workflow successfully completes
+on:
+  workflow_run:
+    workflows: ["lint"]
+    types:
+      - completed
+
+jobs:
+  # Set the job key. The key is displayed as the job name
+  # when a job name is not provided
+  openstack:
+    # Run only if lint step succeeded
+    if: ${{ github.event.workflow_run.conclusion == 'success' }}
+    # Set the type of machine to run on
+    runs-on: ubuntu-latest
+    strategy:
+      fail-fast: false
+      matrix:
+        python-version: ['3.8']
+        cloud-provider: ['openstack']
+
+    steps:
+      - name: Checkout code
+        uses: actions/checkout@v2
+
+      - name: Setup Python
+        uses: actions/setup-python@v2
+        with:
+           python-version: ${{ matrix.python-version }}
+
+      - name: Cache pip dir
+        uses: actions/cache@v2
+        with:
+          path: ~/.cache/pip
+          key: pip-cache-${{ matrix.python-version }}-${{ hashFiles('**/setup.py', '**/requirements.txt') }}
+
+      - name: Install required packages
+        run: pip install tox
+
+      - name: Run tox
+        run: tox -e py${{ matrix.python-version }}-${{ matrix.cloud-provider }}
+        env:
+          PYTHONUNBUFFERED: "True"
+          # openstack
+          OS_AUTH_URL: ${{ secrets.OS_AUTH_URL }}
+          OS_PASSWORD: ${{ secrets.OS_PASSWORD }}
+          OS_PROJECT_NAME: ${{ secrets.OS_PROJECT_NAME }}
+          OS_PROJECT_DOMAIN_NAME: ${{ secrets.OS_PROJECT_DOMAIN_NAME }}
+          OS_TENANT_NAME: ${{ secrets.OS_TENANT_NAME }}
+          OS_USERNAME: ${{ secrets.OS_USERNAME }}
+          OS_REGION_NAME: ${{ secrets.OS_REGION_NAME }}
+          OS_USER_DOMAIN_NAME: ${{ secrets.OS_USER_DOMAIN_NAME }}
+          CB_IMAGE_OS: ${{ secrets.CB_IMAGE_OS }}
+          CB_PLACEMENT_OS: ${{ secrets.CB_PLACEMENT_OS }}
+
+      - name: Coveralls
+        uses: AndreMiras/coveralls-python-action@develop
+        with:
+          github-token: ${{ secrets.GITHUB_TOKEN }}
+          flag-name: run-${{ matrix.python-version }}-${{ matrix.cloud-provider }}
+          parallel: true

+ 18 - 18
README.rst

@@ -9,9 +9,9 @@ Detailed documentation can be found at http://cloudbridge.cloudve.org.
 
 Build Status Tests
 ~~~~~~~~~~~~~~~~~~
-.. image:: https://github.com/CloudVE/cloudbridge/actions/workflows/integration.yaml/badge.svg
+.. image:: https://github.com/CloudVE/cloudbridge/actions/workflows/lint.yaml/badge.svg
    :target: https://github.com/CloudVE/cloudbridge/actions/
-   :alt: Integration Tests
+   :alt: Linting
 
 .. image:: https://codecov.io/gh/CloudVE/cloudbridge/branch/master/graph/badge.svg
    :target: https://codecov.io/gh/CloudVE/cloudbridge
@@ -25,33 +25,33 @@ Build Status Tests
    :target: http://cloudbridge.readthedocs.org/en/latest/?badge=latest
    :alt: Documentation Status
 
-.. |aws-py36| image:: https://travis-matrix-badges.herokuapp.com/repos/CloudVE/cloudbridge/branches/master/1?use_travis_com=yes
-              :target: https://travis-ci.com/CloudVE/cloudbridge
+.. |aws-py38| image:: https://github.com/CloudVE/cloudbridge/actions/workflows/aws.yaml/badge.svg
+              :target: https://github.com/CloudVE/cloudbridge/actions/
 
-.. |azure-py36| image:: https://travis-matrix-badges.herokuapp.com/repos/CloudVE/cloudbridge/branches/master/2?use_travis_com=yes
-                :target: https://travis-ci.com/CloudVE/cloudbridge
+.. |azure-py38| image:: https://github.com/CloudVE/cloudbridge/actions/workflows/azure.yaml/badge.svg
+                :target: https://github.com/CloudVE/cloudbridge/actions/
 
-.. |gcp-py36| image:: https://travis-matrix-badges.herokuapp.com/repos/CloudVE/cloudbridge/branches/master/3?use_travis_com=yes
-              :target: https://travis-ci.com/CloudVE/cloudbridge
+.. |gcp-py38| image:: https://github.com/CloudVE/cloudbridge/actions/workflows/gcp.yaml/badge.svg
+              :target: https://github.com/CloudVE/cloudbridge/actions/
 
-.. |mock-py36| image:: https://travis-matrix-badges.herokuapp.com/repos/CloudVE/cloudbridge/branches/master/4?use_travis_com=yes
-              :target: https://travis-ci.com/CloudVE/cloudbridge
+.. |mock-py38| image:: https://github.com/CloudVE/cloudbridge/actions/workflows/mock.yaml/badge.svg
+              :target: https://github.com/CloudVE/cloudbridge/actions/
 
-.. |os-py36| image:: https://travis-matrix-badges.herokuapp.com/repos/CloudVE/cloudbridge/branches/master/5?use_travis_com=yes
-             :target: https://travis-ci.com/CloudVE/cloudbridge
+.. |os-py38| image:: https://github.com/CloudVE/cloudbridge/actions/workflows/openstack.yaml/badge.svg
+             :target: https://github.com/CloudVE/cloudbridge/actions/
 
 +---------------------------+----------------+
-| **Provider/Environment**  | **Python 3.6** |
+| **Provider/Environment**  | **Python 3.8** |
 +---------------------------+----------------+
-| **Amazon Web Services**   | |aws-py36|     |
+| **Amazon Web Services**   | |aws-py38|     |
 +---------------------------+----------------+
-| **Google Cloud Platform** | |gcp-py36|     |
+| **Google Cloud Platform** | |gcp-py38|     |
 +---------------------------+----------------+
-| **Microsoft Azure**       | |azure-py36|   |
+| **Microsoft Azure**       | |azure-py38|   |
 +---------------------------+----------------+
-| **OpenStack**             | |os-py36|      |
+| **OpenStack**             | |os-py38|      |
 +---------------------------+----------------+
-| **Mock Provider**         | |mock-py36|    |
+| **Mock Provider**         | |mock-py38|    |
 +---------------------------+----------------+
 
 Installation

+ 0 - 10
cloudbridge/__init__.py

@@ -15,16 +15,6 @@ def get_version():
     return __version__
 
 
-def init_logging():
-    """
-    Initialize logging for testing.
-
-    Temporary workaround for build timeouts by enabling logging to
-    stdout so that Travis doesn't think the build has hung.
-    """
-    set_stream_logger(__name__, level=logging.DEBUG)
-
-
 class NullHandler(logging.Handler):
     """A null handler for the logger."""