Skip to content

Commit e5433b3

Browse files
committed
porting to actions
1 parent 4476348 commit e5433b3

File tree

9 files changed

+199
-13
lines changed

9 files changed

+199
-13
lines changed

.coveragerc

+12
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,14 @@
11
[run]
22
source = ccy
3+
data_file = build/.coverage
4+
5+
[html]
6+
directory = build/coverage/html
7+
8+
[xml]
9+
output = build/coverage.xml
10+
11+
[report]
12+
exclude_lines =
13+
pragma: no cover
14+
raise NotImplementedError

.github/workflows/build.yml

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: build
2+
3+
on:
4+
push:
5+
branches-ignore:
6+
- deploy
7+
tags-ignore:
8+
- v*
9+
10+
jobs:
11+
12+
# python 3.6
13+
py36:
14+
runs-on: ubuntu-latest
15+
env:
16+
PYTHON_ENV: ci
17+
18+
steps:
19+
- uses: actions/checkout@v2
20+
- name: build image
21+
run: make py36
22+
- name: run tests
23+
run: make test-py36
24+
25+
26+
# python 3.7
27+
py37:
28+
runs-on: ubuntu-latest
29+
env:
30+
PYTHON_ENV: ci
31+
32+
steps:
33+
- uses: actions/checkout@v2
34+
- name: build image
35+
run: make py37
36+
- name: run tests
37+
run: make test-py37
38+
39+
# python 3.8
40+
py38:
41+
runs-on: ubuntu-latest
42+
env:
43+
PYTHON_ENV: ci
44+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
45+
46+
steps:
47+
- uses: actions/checkout@v2
48+
- name: build image
49+
run: make py38
50+
- name: run docs
51+
run: make test-docs
52+
- name: run flake8
53+
run: make test-flake8
54+
- name: run black
55+
run: make test-black
56+
- name: run tests
57+
run: make test-py38
58+
- name: upload coverage
59+
run: make test-codecov

.github/workflows/release.yml

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: release
2+
3+
on:
4+
push:
5+
branches:
6+
- deploy
7+
tags-ignore:
8+
- v*
9+
10+
jobs:
11+
test:
12+
runs-on: ubuntu-latest
13+
env:
14+
PYTHON_ENV: ci
15+
16+
steps:
17+
- uses: actions/checkout@v2
18+
- name: build image
19+
run: make py38
20+
- name: validate version
21+
run: make test-version
22+
- name: run flake8
23+
run: make test-flake8
24+
- name: run black
25+
run: make test-black
26+
- name: run tests
27+
run: make test-py38
28+
29+
release:
30+
runs-on: ubuntu-latest
31+
needs:
32+
- test
33+
env:
34+
PYTHON_ENV: ci
35+
PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
36+
37+
steps:
38+
- uses: actions/checkout@v2
39+
- name: build python 3.8 image
40+
run: make py38
41+
- name: build python 3.8 bundle
42+
run: make bundle
43+
- name: release to pypi
44+
run: make release

MANIFEST.in

+4-7
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
1-
include LICENSE
21
include MANIFEST.in
32
include README.rst
4-
include config.py
5-
include requirements.txt
6-
include requirements-dev.txt
7-
include docs/make.bat
8-
include docs/Makefile
9-
recursive-include docs/source *
3+
graft ccy
4+
graft dev
5+
graft docs
6+
global-exclude *.pyc

Makefile

+68
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,71 @@ version: ## dipsplay software version
1717

1818
black: ## check black formatting
1919
black --check ccy tests
20+
21+
py36: ## build python 3.6 image for testing
22+
docker build -f dev/Dockerfile --build-arg PY_VERSION=python:3.6.10 -t ccy36 .
23+
24+
py37: ## build python 3.7 image for testing
25+
docker build -f dev/Dockerfile --build-arg PY_VERSION=python:3.7.7 -t ccy37 .
26+
27+
py38: ## build python 3.8 image for testing
28+
docker build -f dev/Dockerfile --build-arg PY_VERSION=python:3.8.3 -t ccy38 .
29+
30+
test-py36: ## test with python 3.6
31+
@docker run --rm --network=host ccy36 pytest
32+
33+
test-py37: ## test with python 3.7
34+
@docker run --rm --network=host ccy37 pytest
35+
36+
test-py38: ## test with python 3.8 with coverage
37+
@docker run --rm \
38+
-v $(PWD)/build:/workspace/build \
39+
ccy38 \
40+
pytest --cov --cov-report xml
41+
42+
test-docs: ## run docs in CI
43+
@docker run --rm \
44+
-v $(PWD)/build:/workspace/build \
45+
ccy38 \
46+
make docs
47+
48+
test-black: ## run black check in CI
49+
@docker run --rm \
50+
-v $(PWD)/build:/workspace/build \
51+
ccy38 \
52+
black ccy tests --check
53+
54+
test-flake8: ## run flake8 in CI
55+
@docker run --rm \
56+
-v $(PWD)/build:/workspace/build \
57+
ccy38 \
58+
flake8
59+
60+
test-codecov: ## upload code coverage
61+
@docker run --rm \
62+
-v $(PWD):/workspace \
63+
ccy38 \
64+
codecov --token $(CODECOV_TOKEN) --file ./build/coverage.xml
65+
66+
bundle: ## build python 3.8 bundle
67+
@docker run --rm \
68+
-v $(PWD):/workspace \
69+
ccy38 \
70+
python setup.py sdist bdist_wheel
71+
72+
github-tag: ## new tag in github
73+
@docker run \
74+
-v $(PWD):/workspace \
75+
-e GITHUB_TOKEN=$(GITHUB_SECRET) \
76+
ccy38 \
77+
agilekit git release --yes
78+
79+
pypi: ## release to pypi and github tag
80+
@docker run --rm \
81+
-v $(PWD):/workspace \
82+
ccy38 \
83+
twine upload dist/* --username lsbardel --password $(PYPI_PASSWORD)
84+
85+
release: ## release to pypi and github tag
86+
make pypi
87+
make github-tag

ccy/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""Python currencies"""
22

3-
__version__ = "1.1.0"
3+
__version__ = "1.1.1"
44

55

66
from .core.country import (

dev/Dockerfile

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
ARG PY_VERSION
2+
3+
FROM $PY_VERSION
4+
5+
ENV GITHUB_USERNAME=qmbot
6+
7+
WORKDIR /workspace
8+
9+
COPY ./dev ./dev
10+
RUN ./dev/install
11+
COPY . .

dev/install.sh dev/install

File renamed without changes.

dev/install-dev.sh

-5
This file was deleted.

0 commit comments

Comments
 (0)