Ver código fonte

Switch to github workflows

Nuwan Goonasekera 5 anos atrás
pai
commit
fb2db2d59c
3 arquivos alterados com 55 adições e 83 exclusões
  1. 54 0
      .github/workflows/integration.yaml
  2. 0 82
      .travis.yml
  3. 1 1
      tox.ini

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

@@ -0,0 +1,54 @@
+name: Integration
+
+# Run this workflow every time a new commit pushed to your repository
+on: [push, pull_request]
+
+jobs:
+  # Set the job key. The key is displayed as the job name
+  # when a job name is not provided
+  integration:
+    # Name the Job
+    name: Run mock integration tests
+    # Set the type of machine to run on
+    runs-on: ubuntu-latest
+    strategy:
+      matrix:
+        python-version: ['3.8']
+        cloud-provider: ['aws', 'azure', 'gcp', 'mock', 'openstack']
+
+    steps:
+      - name: Checkout code
+        uses: actions/checkout@v2
+
+      - 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 ${{ matrix.python-version }}-${{ cloud-provider }}
+
+      - name: Coveralls
+        uses: coverallsapp/github-action@master
+        with:
+          github-token: ${{ secrets.GITHUB_TOKEN }}
+          flag-name: run-${{ matrix.python-version }}-${{ cloud-provider }}
+          parallel: true
+
+  finish:
+    needs: integration
+    runs-on: ubuntu-latest
+    steps:
+    - name: Coveralls Finished
+      uses: coverallsapp/github-action@master
+      with:
+        github-token: ${{ secrets.github_token }}
+        parallel-finished: true

+ 0 - 82
.travis.yml

@@ -1,82 +0,0 @@
-language: python
-cache:
-  directories:
-  - "$HOME/.cache/pip"
-  - "$TRAVIS_BUILD_DIR/.tox"
-os:
-- linux
-matrix:
-  fast_finish: true
-  allow_failures:
-  - os: osx
-  include:
-  - python: 3.6
-    env: TOX_ENV=py36-aws
-  - python: 3.6
-    env: TOX_ENV=py36-azure
-  - python: 3.6
-    env: TOX_ENV=py36-gcp
-  - python: 3.6
-    env: TOX_ENV=py36-mock
-  - python: 3.6
-    env: TOX_ENV=py36-openstack
-env:
-  global:
-    - PYTHONUNBUFFERED=True
-    - COVERALLS_PARALLEL=true
-before_install:
-    - |
-      case "$TRAVIS_EVENT_TYPE" in
-        push|pull_request)
-           # Check whether we need to run a test for this provider
-           DOCS_REGEX='(\.rst$)|(^(docs))/'
-           FILES_IN_CHANGESET="`git diff --name-only $TRAVIS_COMMIT_RANGE`"
-           echo "$FILES_IN_CHANGESET" | grep -qvE "$DOCS_REGEX" || {
-              echo "Only docs were updated. Stopping build process."
-              exit
-           }
-           echo "$FILES_IN_CHANGESET" | grep -qvE "$DOCS_REGEX|(^(cloudbridge/cloud/providers))" || {
-              echo "Only docs and providers were updated. Checking whether this provider was changed."
-              # Extract env and provider from $TOXENV into $PYENV and $PROVIDER respectively
-              IFS=- read PYENV PROVIDER <<< "$TOX_ENV"
-              echo "$FILES_IN_CHANGESET" | grep -qE "^(cloudbridge/cloud/providers/$PROVIDER)" && {
-                 echo "This provider was affected by this changeset. Running tests."
-              } || {
-                 echo "This provider was not affected by this changeset. Stopping build process."
-                 exit
-              }
-           }
-           ;;
-        *)
-           echo "Build triggered through API or CRON job. Running regardless of changes."
-           ;;
-      esac
-install:
-    - pip install -U pip
-    - pip install -U setuptools
-    - pip install "coverage<5"
-    - pip install tox
-    - pip install coveralls
-    - pip install codecov
-script:
-    - tox -e $TOX_ENV
-after_script:
-    - |
-      case "$TRAVIS_EVENT_TYPE" in
-        push|pull_request)
-           # Don't run coverage if tests or cloudbridge interface was not affected
-           DOCS_REGEX='(\.rst$)|(^(docs))/'
-           FILES_IN_CHANGESET="`git diff --name-only $TRAVIS_COMMIT_RANGE`"
-           echo "$FILES_IN_CHANGESET" | grep -qvE "$DOCS_REGEX|(^(cloudbridge/cloud/providers))" && {
-              coveralls; codecov;
-           } || {
-              echo "Only docs and providers were updated. Not running coverage."
-           }
-           ;;
-        *)
-           echo "Build triggered through API or CRON job. Running regardless of changes"
-           coveralls; codecov;
-           ;;
-      esac
-notifications:
-    webhooks: https://coveralls.io/webhook

+ 1 - 1
tox.ini

@@ -30,4 +30,4 @@ passenv =
     mock: CB_IMAGE_AWS CB_INSTANCE_TYPE_AWS CB_PLACEMENT_AWS AWS_ACCESS_KEY AWS_SECRET_KEY
     mock: CB_IMAGE_AWS CB_INSTANCE_TYPE_AWS CB_PLACEMENT_AWS AWS_ACCESS_KEY AWS_SECRET_KEY
 deps =
 deps =
     -rrequirements.txt
     -rrequirements.txt
-    coverage<5
+    coverage