From 6707c1287a2e92ef97b69092c691de1f60f15ef3 Mon Sep 17 00:00:00 2001 From: Wesley Fideles Date: Fri, 10 Jun 2022 19:22:00 -0400 Subject: [PATCH 1/6] Adicionando pipeline DevOps --- .github/workflows/pipeline.yml | 73 ++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 .github/workflows/pipeline.yml diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml new file mode 100644 index 000000000..53364727b --- /dev/null +++ b/.github/workflows/pipeline.yml @@ -0,0 +1,73 @@ +name: CI - Lint / Tests / Deploy + +on: [push] + +jobs: + + lint: + runs-on: ubuntu-20.04 + + steps: + - uses: actions/checkout@v2 + + - name: Set up Python 3.9 + uses: actions/setup-python@v2 + with: + python-version: 3.9 + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install flake8 + + - 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 + + tests: + needs: lint + runs-on: ubuntu-20.04 + strategy: + matrix: + python-version: [3.6, 3.7, 3.8, 3.9] + + steps: + - 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: | + python -m pip install --upgrade pip + pip install flake8 pytest + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + + - name: Integrations Test + run: | + python test.py + + + deploy: + needs: tests + runs-on: ubuntu-20.04 + + steps: + - uses: actions/checkout@v2 + + - name: Set up Python 3.9 + uses: actions/setup-python@v2 + with: + python-version: 3.9 + + - name: deploy into heroku + uses: akhileshns/heroku-deploy@v3.12.12 + with: + heroku_api_key: ${{secrets.HEROKU_API_KEY}} + heroku_app_name: ${{secrets.HEROKU_APP_NAME}} + heroku_email: ${{secrets.HEROKU_USER_EMAIL}} From 047292aef66b788a091727de9862644952ddd36c Mon Sep 17 00:00:00 2001 From: Wesley Fideles Date: Fri, 10 Jun 2022 19:23:51 -0400 Subject: [PATCH 2/6] Adicionando pipeline DevOps --- templates/pipeline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/pipeline.yml b/templates/pipeline.yml index 53364727b..7ca4883b6 100644 --- a/templates/pipeline.yml +++ b/templates/pipeline.yml @@ -32,7 +32,7 @@ jobs: runs-on: ubuntu-20.04 strategy: matrix: - python-version: [3.6, 3.7, 3.8, 3.9] + python-version: [3.5, 3.6, 3.7, 3.8, 3.9] steps: - uses: actions/checkout@v2 From 855206b22001b0df533aedee9bb79e765497ce33 Mon Sep 17 00:00:00 2001 From: Wesley Fideles Date: Fri, 10 Jun 2022 19:25:21 -0400 Subject: [PATCH 3/6] Adicionando pipeline DevOps --- templates/pipeline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/pipeline.yml b/templates/pipeline.yml index 7ca4883b6..3e9398f9e 100644 --- a/templates/pipeline.yml +++ b/templates/pipeline.yml @@ -32,7 +32,7 @@ jobs: runs-on: ubuntu-20.04 strategy: matrix: - python-version: [3.5, 3.6, 3.7, 3.8, 3.9] + python-version: [3.9] steps: - uses: actions/checkout@v2 From 25cc7079d3ab14fc68466da1e0a5fbcae349b094 Mon Sep 17 00:00:00 2001 From: Wesley Fideles Date: Fri, 10 Jun 2022 19:36:03 -0400 Subject: [PATCH 4/6] Adicionando pipeline DevOps --- templates/pipeline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/pipeline.yml b/templates/pipeline.yml index 3e9398f9e..7ca4883b6 100644 --- a/templates/pipeline.yml +++ b/templates/pipeline.yml @@ -32,7 +32,7 @@ jobs: runs-on: ubuntu-20.04 strategy: matrix: - python-version: [3.9] + python-version: [3.5, 3.6, 3.7, 3.8, 3.9] steps: - uses: actions/checkout@v2 From 5d9c0168c11431c7fe1b3855e7db6612016ee242 Mon Sep 17 00:00:00 2001 From: Wesley Fideles Date: Fri, 10 Jun 2022 19:38:58 -0400 Subject: [PATCH 5/6] Adicionando pipeline DevOps --- templates/pipeline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/pipeline.yml b/templates/pipeline.yml index 7ca4883b6..53364727b 100644 --- a/templates/pipeline.yml +++ b/templates/pipeline.yml @@ -32,7 +32,7 @@ jobs: runs-on: ubuntu-20.04 strategy: matrix: - python-version: [3.5, 3.6, 3.7, 3.8, 3.9] + python-version: [3.6, 3.7, 3.8, 3.9] steps: - uses: actions/checkout@v2 From 75896dd3e0d5737ea4ce9f0e10b693bf765c8473 Mon Sep 17 00:00:00 2001 From: Wesley Fideles Date: Fri, 10 Jun 2022 19:45:21 -0400 Subject: [PATCH 6/6] Adicionando pipeline DevOps --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 9e0bc2cae..ed9523e3a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,2 @@ -Flask==2.0.1 +Flask==2.0.3 gunicorn