From 06ccbb86342cf4f3a8c445aec2ced1cbdbbb2438 Mon Sep 17 00:00:00 2001 From: shahules786 Date: Thu, 6 Oct 2022 11:31:43 +0530 Subject: [PATCH] ci/cd --- .github/workflows/ci.yaml | 49 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 .github/workflows/ci.yaml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..f07c39e --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,49 @@ +# 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: Enhancer + +on: + push: + branches: [ dev ] + pull_request: + branches: [ dev ] +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: [3.8] + steps: + - uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v1.1.1 + env : + ACTIONS_ALLOW_UNSECURE_COMMANDS : true + with: + python-version: ${{ matrix.python-version }} + - name: Cache pip + uses: actions/cache@v1 + with: + path: ~/.cache/pip # This path is specific to Ubuntu + # Look to see if there is a cache hit for the corresponding requirements file + key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }} + restore-keys: | + ${{ runner.os }}-pip- + ${{ runner.os }}- + # You can test your matrix by printing the current Python version + - name: Display Python version + run: python -c "import sys; print(sys.version)" + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + pip install black flake8 pytest + - name: Run black + run: + black --check . + - name: Run flake8 + run: flake8 + - name: Test with pytest + run: | + pytest tests \ No newline at end of file