From 88b1f9dacfb8102de277a8d204e2ba8b8b49d0cc Mon Sep 17 00:00:00 2001 From: Gabriel Date: Wed, 24 Mar 2021 22:53:23 -0300 Subject: [PATCH 01/14] Create CI --- .github/workflows/ci_workflow.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 .github/workflows/ci_workflow.yml diff --git a/.github/workflows/ci_workflow.yml b/.github/workflows/ci_workflow.yml new file mode 100644 index 00000000..82f2925c --- /dev/null +++ b/.github/workflows/ci_workflow.yml @@ -0,0 +1,15 @@ +name: CI + +on: [pull_request] + +jobs: + test: + runs-on: ubuntu-latest + steps: + - name: Checkout action + uses: actions/checkout@v2 + - name: Django Coverage action + uses: actions/python-django-coverage-gitHub-action@0.9 + with: + django-app: 'api' + minimum-coverage: '90' \ No newline at end of file From e643fbb45e17d7b79ddf45edf6bd82fe144f7b28 Mon Sep 17 00:00:00 2001 From: Gabriel Date: Wed, 24 Mar 2021 23:02:32 -0300 Subject: [PATCH 02/14] Add lint --- .github/workflows/ci_workflow.yml | 36 ++++++++++++++++++++++--------- 1 file changed, 26 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci_workflow.yml b/.github/workflows/ci_workflow.yml index 82f2925c..90333b26 100644 --- a/.github/workflows/ci_workflow.yml +++ b/.github/workflows/ci_workflow.yml @@ -2,14 +2,30 @@ name: CI on: [pull_request] -jobs: - test: - runs-on: ubuntu-latest - steps: - - name: Checkout action - uses: actions/checkout@v2 - - name: Django Coverage action - uses: actions/python-django-coverage-gitHub-action@0.9 + jobs: + build: + runs-on: ubuntu-latest + strategy: + max-parallel: 4 + matrix: + python-version: [3.7] + steps: + - uses: actions/checkout@v1 + - name: Set up Python 3.7 + uses: actions/setup-python@v1 with: - django-app: 'api' - minimum-coverage: '90' \ No newline at end of file + python-version: 3.7 + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements/local.txt + - name: Lint with flake8 + run: | + pip install flake8 + flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics + flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + # - name: Django Testing project + # env: + # DATABASE_URL: ${{ secrets.DATABASE_URL }} + # run: | + # python3 manage.py test \ No newline at end of file From d87220f246cccdf86fddc836e08d299de028b6c8 Mon Sep 17 00:00:00 2001 From: Gabriel Date: Wed, 24 Mar 2021 23:05:05 -0300 Subject: [PATCH 03/14] Add lint --- .github/workflows/ci_workflow.yml | 56 ++++++++++++++++--------------- 1 file changed, 29 insertions(+), 27 deletions(-) diff --git a/.github/workflows/ci_workflow.yml b/.github/workflows/ci_workflow.yml index 90333b26..41108aad 100644 --- a/.github/workflows/ci_workflow.yml +++ b/.github/workflows/ci_workflow.yml @@ -2,30 +2,32 @@ name: CI on: [pull_request] - jobs: - build: - runs-on: ubuntu-latest - strategy: - max-parallel: 4 - matrix: - python-version: [3.7] - steps: - - uses: actions/checkout@v1 - - name: Set up Python 3.7 - uses: actions/setup-python@v1 - with: - python-version: 3.7 - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install -r requirements/local.txt - - name: Lint with flake8 - run: | - pip install flake8 - flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics - flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - # - name: Django Testing project - # env: - # DATABASE_URL: ${{ secrets.DATABASE_URL }} - # run: | - # python3 manage.py test \ No newline at end of file +jobs: + build: + runs-on: ubuntu-latest + strategy: + max-parallel: 4 + matrix: + python-version: [3.7] + + + steps: + - uses: actions/checkout@v1 + - name: Set up Python 3.7 + uses: actions/setup-python@v1 + with: + python-version: 3.7 + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements/local.txt + - name: Lint with flake8 + run: | + pip install flake8 + flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics + flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + # - name: Django Testing project + # env: + # DATABASE_URL: ${{ secrets.DATABASE_URL }} + # run: | + # python3 manage.py test \ No newline at end of file From b024fdf6044e4a561ccac3c345971fe049864036 Mon Sep 17 00:00:00 2001 From: Gabriel Date: Wed, 24 Mar 2021 23:05:58 -0300 Subject: [PATCH 04/14] Add lint --- .github/workflows/ci_workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci_workflow.yml b/.github/workflows/ci_workflow.yml index 41108aad..aab2ae21 100644 --- a/.github/workflows/ci_workflow.yml +++ b/.github/workflows/ci_workflow.yml @@ -20,7 +20,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install -r requirements/local.txt + pip install -r requirements.txt - name: Lint with flake8 run: | pip install flake8 From 5bc479175731c4579acb833a00309eb8ead34b5d Mon Sep 17 00:00:00 2001 From: Gabriel Date: Wed, 24 Mar 2021 23:10:11 -0300 Subject: [PATCH 05/14] Add lint --- .github/workflows/ci_workflow.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/ci_workflow.yml b/.github/workflows/ci_workflow.yml index aab2ae21..94452e87 100644 --- a/.github/workflows/ci_workflow.yml +++ b/.github/workflows/ci_workflow.yml @@ -24,8 +24,7 @@ jobs: - name: Lint with flake8 run: | pip install flake8 - flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics - flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + flake8 --max-line-length=127 --statistics src/*.py # - name: Django Testing project # env: # DATABASE_URL: ${{ secrets.DATABASE_URL }} From e2dc0567809c5da0377dbf95ae1a8da0c2fca3f0 Mon Sep 17 00:00:00 2001 From: Gabriel Date: Wed, 24 Mar 2021 23:13:16 -0300 Subject: [PATCH 06/14] Add lint --- .github/workflows/ci_workflow.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/ci_workflow.yml b/.github/workflows/ci_workflow.yml index 94452e87..bb2cc54f 100644 --- a/.github/workflows/ci_workflow.yml +++ b/.github/workflows/ci_workflow.yml @@ -9,8 +9,6 @@ jobs: max-parallel: 4 matrix: python-version: [3.7] - - steps: - uses: actions/checkout@v1 - name: Set up Python 3.7 @@ -24,7 +22,7 @@ jobs: - name: Lint with flake8 run: | pip install flake8 - flake8 --max-line-length=127 --statistics src/*.py + flake8 src/*.py # - name: Django Testing project # env: # DATABASE_URL: ${{ secrets.DATABASE_URL }} From 5f4530a2227cbf1f87f25af4e6480227724a5187 Mon Sep 17 00:00:00 2001 From: Gabriel Date: Wed, 24 Mar 2021 23:18:01 -0300 Subject: [PATCH 07/14] Add lint --- .github/workflows/ci_workflow.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci_workflow.yml b/.github/workflows/ci_workflow.yml index bb2cc54f..b845a88f 100644 --- a/.github/workflows/ci_workflow.yml +++ b/.github/workflows/ci_workflow.yml @@ -19,10 +19,14 @@ jobs: run: | python -m pip install --upgrade pip pip install -r requirements.txt - - name: Lint with flake8 + - name: Lint with flake8 models run: | pip install flake8 - flake8 src/*.py + flake8 --max-line-length=127 src/api/models/*.py + - name: Lint with flake8 view + run: | + pip install flake8 + flake8 --max-line-length=127 src/api/views/*.py # - name: Django Testing project # env: # DATABASE_URL: ${{ secrets.DATABASE_URL }} From 425f3e59fe7a82cd0630b0b7441d6c6b037ffbe6 Mon Sep 17 00:00:00 2001 From: Gabriel Date: Wed, 24 Mar 2021 23:25:27 -0300 Subject: [PATCH 08/14] Add lint --- .github/workflows/ci_workflow.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci_workflow.yml b/.github/workflows/ci_workflow.yml index b845a88f..93f18e84 100644 --- a/.github/workflows/ci_workflow.yml +++ b/.github/workflows/ci_workflow.yml @@ -22,11 +22,12 @@ jobs: - name: Lint with flake8 models run: | pip install flake8 - flake8 --max-line-length=127 src/api/models/*.py + flake8 --max-line-length=127 src/api/*.py + - name: Lint with flake8 view run: | pip install flake8 - flake8 --max-line-length=127 src/api/views/*.py + flake8 --max-line-length=127 src/**/*.py # - name: Django Testing project # env: # DATABASE_URL: ${{ secrets.DATABASE_URL }} From 33872fe28df0f23540ca2a44855aded5eb51eb4e Mon Sep 17 00:00:00 2001 From: Gabriel Date: Wed, 24 Mar 2021 23:26:51 -0300 Subject: [PATCH 09/14] Fix lint --- .github/workflows/ci_workflow.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/ci_workflow.yml b/.github/workflows/ci_workflow.yml index 93f18e84..d4aeb561 100644 --- a/.github/workflows/ci_workflow.yml +++ b/.github/workflows/ci_workflow.yml @@ -20,14 +20,10 @@ jobs: python -m pip install --upgrade pip pip install -r requirements.txt - name: Lint with flake8 models - run: | - pip install flake8 - flake8 --max-line-length=127 src/api/*.py - - - name: Lint with flake8 view run: | pip install flake8 flake8 --max-line-length=127 src/**/*.py + # - name: Django Testing project # env: # DATABASE_URL: ${{ secrets.DATABASE_URL }} From 4e442c6b96bbd339f42bd7edde51602acef079e2 Mon Sep 17 00:00:00 2001 From: Gabriel Date: Wed, 24 Mar 2021 23:31:17 -0300 Subject: [PATCH 10/14] Fix lint --- .github/workflows/ci_workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci_workflow.yml b/.github/workflows/ci_workflow.yml index d4aeb561..f44db5e3 100644 --- a/.github/workflows/ci_workflow.yml +++ b/.github/workflows/ci_workflow.yml @@ -22,7 +22,7 @@ jobs: - name: Lint with flake8 models run: | pip install flake8 - flake8 --max-line-length=127 src/**/*.py + flake8 --max-line-length=127 src/**/**/*.py # - name: Django Testing project # env: From 4e1e2736b0797c5b63ab442140620611ad76e8bd Mon Sep 17 00:00:00 2001 From: Gabriel Date: Wed, 24 Mar 2021 23:44:15 -0300 Subject: [PATCH 11/14] Add test job --- .github/workflows/ci_workflow.yml | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci_workflow.yml b/.github/workflows/ci_workflow.yml index f44db5e3..b79f3467 100644 --- a/.github/workflows/ci_workflow.yml +++ b/.github/workflows/ci_workflow.yml @@ -3,7 +3,8 @@ name: CI on: [pull_request] jobs: - build: + + lint: runs-on: ubuntu-latest strategy: max-parallel: 4 @@ -24,8 +25,22 @@ jobs: pip install flake8 flake8 --max-line-length=127 src/**/**/*.py - # - name: Django Testing project - # env: - # DATABASE_URL: ${{ secrets.DATABASE_URL }} - # run: | - # python3 manage.py test \ No newline at end of file + test: + runs-on: ubuntu-latest + strategy: + max-parallel: 4 + matrix: + python-version: [3.7] + steps: + - uses: actions/checkout@v1 + - name: Set up Python 3.7 + uses: actions/setup-python@v1 + with: + python-version: 3.7 + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + - name: Lint with flake8 models + run: | + python3 src/manage.py test \ No newline at end of file From 510d18e02fb3b2854ee6f034e3669b192aa76f00 Mon Sep 17 00:00:00 2001 From: Gabriel Date: Wed, 24 Mar 2021 23:55:19 -0300 Subject: [PATCH 12/14] Add test job --- .github/workflows/ci_workflow.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/ci_workflow.yml b/.github/workflows/ci_workflow.yml index b79f3467..5b1b7493 100644 --- a/.github/workflows/ci_workflow.yml +++ b/.github/workflows/ci_workflow.yml @@ -26,6 +26,14 @@ jobs: flake8 --max-line-length=127 src/**/**/*.py test: + env: + MONGO_INITDB_ROOT_USERNAME: dev + MONGO_INITDB_ROOT_PASSWORD: dev + MONGO_INITDB_DATABASE: botflowapi + services: + mongodb: + image: mongo + ports: ["27017:27017"] runs-on: ubuntu-latest strategy: max-parallel: 4 From ca28cb1797ab08156c431149eb8a2f112e1c5457 Mon Sep 17 00:00:00 2001 From: Gabriel Date: Wed, 24 Mar 2021 23:57:00 -0300 Subject: [PATCH 13/14] Fix test job --- .github/workflows/ci_workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci_workflow.yml b/.github/workflows/ci_workflow.yml index 5b1b7493..b98bce48 100644 --- a/.github/workflows/ci_workflow.yml +++ b/.github/workflows/ci_workflow.yml @@ -31,7 +31,7 @@ jobs: MONGO_INITDB_ROOT_PASSWORD: dev MONGO_INITDB_DATABASE: botflowapi services: - mongodb: + MONGO_DATABASE: image: mongo ports: ["27017:27017"] runs-on: ubuntu-latest From 6fa88c4750900a1ea8091f5cca4892ead4991cff Mon Sep 17 00:00:00 2001 From: Gabriel Date: Wed, 24 Mar 2021 23:58:33 -0300 Subject: [PATCH 14/14] Comment test job --- .github/workflows/ci_workflow.yml | 56 +++++++++++++++---------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/.github/workflows/ci_workflow.yml b/.github/workflows/ci_workflow.yml index b98bce48..909349cf 100644 --- a/.github/workflows/ci_workflow.yml +++ b/.github/workflows/ci_workflow.yml @@ -24,31 +24,31 @@ jobs: run: | pip install flake8 flake8 --max-line-length=127 src/**/**/*.py - - test: - env: - MONGO_INITDB_ROOT_USERNAME: dev - MONGO_INITDB_ROOT_PASSWORD: dev - MONGO_INITDB_DATABASE: botflowapi - services: - MONGO_DATABASE: - image: mongo - ports: ["27017:27017"] - runs-on: ubuntu-latest - strategy: - max-parallel: 4 - matrix: - python-version: [3.7] - steps: - - uses: actions/checkout@v1 - - name: Set up Python 3.7 - uses: actions/setup-python@v1 - with: - python-version: 3.7 - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install -r requirements.txt - - name: Lint with flake8 models - run: | - python3 src/manage.py test \ No newline at end of file + + # test: + # env: + # MONGO_INITDB_ROOT_USERNAME: dev + # MONGO_INITDB_ROOT_PASSWORD: dev + # MONGO_INITDB_DATABASE: botflowapi + # services: + # MONGO_DATABASE: + # image: mongo + # ports: ["27017:27017"] + # runs-on: ubuntu-latest + # strategy: + # max-parallel: 4 + # matrix: + # python-version: [3.7] + # steps: + # - uses: actions/checkout@v1 + # - name: Set up Python 3.7 + # uses: actions/setup-python@v1 + # with: + # python-version: 3.7 + # - name: Install dependencies + # run: | + # python -m pip install --upgrade pip + # pip install -r requirements.txt + # - name: Lint with flake8 models + # run: | + # python3 src/manage.py test \ No newline at end of file