summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAsif Saif Uddin (Auvi) <auvipy@gmail.com>2021-02-25 19:58:11 +0600
committerAsif Saif Uddin (Auvi) <auvipy@gmail.com>2021-02-25 19:58:11 +0600
commit646afc1d49db2c93cf66c03b020a89593a7e60f9 (patch)
treecaee427aaffffae80d3f5304c143a1b8c3ce8586
parentae9ce769c3a51d19f101f83b6fbcb8087388bc43 (diff)
downloadkombu-646afc1d49db2c93cf66c03b020a89593a7e60f9.tar.gz
added initial draft github action workflow
-rw-r--r--.github/workflows/workflow.yaml88
1 files changed, 88 insertions, 0 deletions
diff --git a/.github/workflows/workflow.yaml b/.github/workflows/workflow.yaml
new file mode 100644
index 00000000..69eb8b15
--- /dev/null
+++ b/.github/workflows/workflow.yaml
@@ -0,0 +1,88 @@
+# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
+# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
+
+name: Kombu
+
+on:
+ push:
+ branches: [ master ]
+ pull_request:
+ branches: [ master ]
+
+env:
+ GITHUB_WORKFLOW: true
+
+jobs:
+ build:
+
+ runs-on: ${{ matrix.os }}
+ strategy:
+ fail-fast: false
+ matrix:
+ os: [ubuntu-20.04, macos-latest, windows-latest]
+ python-version: ['3.6', '3.7', '3.8', '3.9', 'pypy3']
+ exclude:
+ - os: macos-latest
+ python-version: 3.6, 3.7
+ - os: windows-latest
+ python-version: 3.6, 3.7
+ # additional service containers to run
+ services:
+ # postgres service
+ rabbitmq:
+ # docker hub image
+ image: rabbitmq
+ # configure the instance
+ env:
+ RABBITMQ_DEFAULT_USER: craiga
+ RABBITMQ_DEFAULT_PASS: security_is_important
+ ports:
+ - 5432:5432
+ # set health checks to wait until service has started
+ options: >-
+ --healthcheck_cmd = /bin/bash -c 'rabbitmq-diagnostics ping -q'
+ --healthcheck_interval = 10
+ --healthcheck_timeout = 10
+ --healthcheck_retries = 30
+ --healthcheck_start_period = 5
+
+ steps:
+ - uses: actions/checkout@v2
+ - name: Set up Python ${{ matrix.python-version }}
+ uses: actions/setup-python@v2
+ with:
+ python-version: ${{ matrix.python-version }}
+
+ - name: Get pip cache dir
+ id: pip-cache
+ run: |
+ echo "::set-output name=dir::$(pip cache dir)"
+ - name: Cache
+ uses: actions/cache@v2
+ with:
+ path: ${{ steps.pip-cache.outputs.dir }}
+ key:
+ ${{ matrix.python-version }}-v1-${{ hashFiles('**/setup.py') }}
+ restore-keys: |
+ ${{ matrix.python-version }}-v1-
+ - name: Install dependencies
+ run: |
+ python -m pip install --upgrade pip
+ python -m pip install flake8 pytest case pytest-celery pytest-subtests pytest-timeout pytest-cov
+ python -m pip install moto boto3 msgpack PyYAML
+ if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
+ - name: Run Unit test with tox-docker
+ run: |
+ PYTHONPATH=. pytest -xv --cov=celery --cov-report=xml --cov-report term t/unit
+ - name: Lint with flake8
+ run: |
+ # stop the build if there are Python syntax errors or undefined names
+ flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
+ # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
+ flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
+ - uses: codecov/codecov-action@v1
+ with:
+ token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos
+ flags: unittests # optional
+ fail_ci_if_error: true # optional (default = false)
+ verbose: true # optional (default = false)