Skip to content

Commit

Permalink
Merge 24e0956 into 9f8a659
Browse files Browse the repository at this point in the history
  • Loading branch information
heynemann committed Jan 25, 2022
2 parents 9f8a659 + 24e0956 commit 34ef2da
Show file tree
Hide file tree
Showing 20 changed files with 1,104 additions and 397 deletions.
39 changes: 31 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
name: build
on: [push, pull_request]
jobs:
Expand All @@ -6,18 +7,35 @@ jobs:
strategy:
fail-fast: false
matrix:
image-tag:
- 37
- 38
- 39
- 310
python-version:
- '3.7'
- '3.8'
- '3.9'
- '3.10'
# container: thumbororg/thumbor-test:${{ matrix.image-tag }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
architecture: x64
- name: Code Climate Before Build
if: matrix.python-version == '3.10'
env:
code_climate_token: ${{ secrets.CODE_CLIMATE_TOKEN }}
run: |-
curl -L -O https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64
chmod +x test-reporter-latest-linux-amd64
./test-reporter-latest-linux-amd64 before-build
- name: APT Update
run: sudo apt-get update -y
- name: APT Install
run: sudo apt-get install -y python3-dev libcurl4-openssl-dev libgnutls28-dev python3-all-dev make zlib1g-dev gcc libssl-dev build-essential
run: sudo apt-get install -y python3-dev libcurl4-openssl-dev libgnutls28-dev
python3-all-dev make zlib1g-dev gcc libssl-dev build-essential
- name: Create Virtualenv
run: python3 -m venv ~/thumbor-aws
- name: Activate Virtualenv
run: source ~/thumbor-aws/bin/activate
- name: Setup
run: make setup
- name: Run Unit Tests
Expand All @@ -29,10 +47,15 @@ jobs:
- name: Lint
run: make flake pylint
- name: Coveralls
if: matrix.image-tag == '310'
if: matrix.python-version == '3.10'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
pip install --upgrade coveralls
coveralls --service=github
- name: Code Climate After Build
if: matrix.python-version == '3.10'
env:
code_climate_token: ${{ secrets.CODE_CLIMATE_TOKEN }}
run: |-
./test-reporter-latest-linux-amd64 after-build -t cobertura --exit-code 0 -r ${code_climate_token}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -128,3 +128,6 @@ dmypy.json
# Pyre type checker
.pyre/
test-results/
cobertura.xml
coverage
cc-test-reporter
12 changes: 8 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
rev: v4.1.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
Expand All @@ -14,10 +14,14 @@ repos:
hooks:
- id: black
- repo: https://github.com/pycqa/flake8
rev: '' # pick a git hash / tag to point to
rev: 4.0.1 # pick a git hash / tag to point to
hooks:
- id: flake8
- repo: https://github.com/pycqa/pylint
rev: pylint-2.6.0
- repo: local
hooks:
- id: pylint
name: pylint
entry: pylint
language: system
types: [python]
args: [--rcfile=pylintrc]
20 changes: 14 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,23 @@ PYTHON = python
OS := $(shell uname)

setup:
@$(PYTHON) -m pip install -e .[tests]
@pip install -U pip
@pip install -U coverage
@pip install -e .[tests]

services:
@docker-compose up
services: docker-down
@docker-compose up --remove-orphans

ci:
@docker-compose up -d
ci: docker-down docker-up
@./wait-for-it.sh localhost:4566 -- echo "Docker Compose is Up. Running tests..."
@pytest -sv --junit-xml=test-results/unit/results.xml --cov=thumbor_aws tests/
@coverage run -m pytest tests && coverage xml && mv coverage.xml cobertura.xml

docker-up:
@docker-compose up --remove-orphan -d

docker-down:
@docker-compose stop
@docker-compose rm -f

test:
@$(MAKE) unit
Expand Down

0 comments on commit 34ef2da

Please sign in to comment.