diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 8e8ebe0d..00000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,65 +0,0 @@ -version: 2.1 - -jobs: - verify_build: - working_directory: ~/repo - docker: - - image: circleci/python:<< parameters.python >> - parameters: - python: - type: string - steps: - - checkout - - restore_cache: - keys: - - v1-dependencies-<< parameters.python >>-{{ checksum "setup.py" }} - # fallback to using the latest cache if no exact match is found - - v1-dependencies-<< parameters.python >>-- - - run: - name: Install Dependencies - command: | - pip install virtualenv - virtualenv venv - source venv/bin/activate - pip install .[dev] - - run: - name: Run Unit Tests - command: | - source venv/bin/activate - nose2 -v - - run: - name: Lint - command: | - source venv/bin/activate - flake8 datadog_lambda/ - - run: - name: Check Formatting - command: | - source venv/bin/activate - ./scripts/check_format.sh - - - save_cache: - paths: - - ./venv - key: v1-dependencies-<< parameters.python >>-{{ checksum "setup.py" }} - -workflows: - python-v2.7: - jobs: - - verify_build: - python: "2.7" - - python-v3.6: - jobs: - - verify_build: - python: "3.6" - - python-v3.7: - jobs: - - verify_build: - python: "3.7" - - python-v3.8: - jobs: - - verify_build: - python: "3.8" diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..945a9028 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,61 @@ +name: build + +on: push + +jobs: + lint: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: 3.7 + + - name: Install dependencies + run: | + pip install virtualenv + virtualenv venv + source venv/bin/activate + pip install .[dev] + + - name: Check formatting + run: | + source venv/bin/activate + ./scripts/check_format.sh + + - name: Lint + run: | + source venv/bin/activate + flake8 datadog_lambda/ + + test: + runs-on: ubuntu-latest + strategy: + max-parallel: 4 + matrix: + python-version: [2.7, 3.6, 3.7, 3.8] + + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + + - name: Install dependencies + run: | + pip install virtualenv + virtualenv venv + source venv/bin/activate + pip install .[dev] + + - name: Run tests + run: | + source venv/bin/activate + nose2 -v diff --git a/README.md b/README.md index b8901975..ffdee511 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # datadog-lambda-python -[![CircleCI](https://img.shields.io/circleci/build/github/DataDog/datadog-lambda-python)](https://circleci.com/gh/DataDog/datadog-lambda-python) +![build](https://github.com/DataDog/datadog-lambda-python/workflows/build/badge.svg) [![PyPI](https://img.shields.io/pypi/v/datadog-lambda)](https://pypi.org/project/datadog-lambda/) ![PyPI - Python Version](https://img.shields.io/pypi/pyversions/datadog-lambda) [![Slack](https://img.shields.io/badge/slack-%23serverless-blueviolet?logo=slack)](https://datadoghq.slack.com/channels/serverless/)