Skip to content

Commit

Permalink
Merge pull request #61 from tartiflette/bubu/update_github_workflow
Browse files Browse the repository at this point in the history
Update github workflow to only one build.
  • Loading branch information
abusi authored Oct 15, 2019
2 parents 4fc7958 + 1029ec9 commit fc58d0a
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 83 deletions.
44 changes: 24 additions & 20 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,41 @@
on: [push, pull_request]
on: [push]
name: check and build
jobs:
build_publish_and_release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: build docker image
uses: actions/docker/cli@master
with:
args: build -t tartiflette-aiohttp .
- name: complexity
uses: actions/docker/cli@master
with:
args: run -i tartiflette-aiohttp make complexity
- name: style
uses: actions/docker/cli@master
with:
args: run -i tartiflette-aiohttp make style
- name: integration test
uses: actions/docker/cli@master
uses: ./
with:
args: run -i tartiflette-aiohttp make test-integration
args: make style
- name: functional test
uses: actions/docker/cli@master
uses: ./
with:
args: run -i tartiflette-aiohttp make test-functional
args: make test-functional
- name: unit test
uses: actions/docker/cli@master
uses: ./
with:
args: run -i tartiflette-aiohttp make test-unit
args: make test-unit
- name: integration test
uses: ./
with:
args: make test-integration
- name: build and publish to pypi
uses: ./.github/actions/pypi/
if: github.ref != 'refs/heads/master'
env:
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }}
- name: set version and changelog
uses: ./.github/actions/shell/
if: github.ref == 'refs/heads/master'
with:
entrypoint: make
args: github-action-version-and-changelog
- name: release
uses: ./.github/actions/release/
if: github.ref == 'refs/heads/master'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPOSITORY: tartiflette-aiohttp
USERNAME: tartiflette
52 changes: 0 additions & 52 deletions .github/workflows/push_on_master.yml

This file was deleted.

33 changes: 24 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
SET_ALPHA_VERSION = 0
PKG_VERSION := $(shell cat setup.py | grep "_VERSION =" | egrep -o "([0-9]+\\.[0-9]+\\.[0-9]+)")
PKG_VERSION := $(shell cat setup.py | grep "_VERSION =" | egrep -o '[0-9]+\.[0-9]+\.[0-9]+(rc[0-9]+)?')

REF := $(shell cat /github/workflow/event.json | jq ".ref")

ifneq ($(REF),"refs/heads/master")
PKG_VERSION := $(shell echo | awk -v pkg_version="$(PKG_VERSION)" -v build_number="$(shell date +\"%s\")" '{print pkg_version "a" build_number}')
PKG_VERSION := $(shell echo | awk -v pkg_version="$(PKG_VERSION)" -v build_number="$(shell date +\"%s\")" '{print pkg_version "dev" build_number}')
SET_ALPHA_VERSION = 1
endif

PATH_TO_MAKEFILE := /github/workspace/Makefile
ifneq ("$(wildcard $(PATH_TO_MAKEFILE))","")
IN_GITHUB_ACTION := 1
else
IN_GITHUB_ACTION := 0
endif

.PHONY: init
init:
true
Expand All @@ -31,25 +38,33 @@ check-format:
.PHONY: style
style: check-format check-import
pylint tartiflette_aiohttp --rcfile=pylintrc

.PHONY: complexity
complexity:
xenon --max-absolute B --max-modules B --max-average A tartiflette_aiohttp
ifeq ($(IN_GITHUB_ACTION),1)
make clean
endif

.PHONY: test-integration
test-integration: clean
mkdir -p reports
py.test -s tests/integration --junitxml=reports/report_integ_tests.xml --cov . --cov-config .coveragerc --cov-report term-missing --cov-report xml:reports/coverage_integ.xml
ifeq ($(IN_GITHUB_ACTION),1)
make clean
endif

.PHONY: test-unit
test-unit: clean
mkdir -p reports
py.test -s tests/unit --junitxml=reports/report_unit_tests.xml --cov . --cov-config .coveragerc --cov-report term-missing --cov-report xml:reports/coverage_func.xml
py.test -s tests/unit --junitxml=reports/report_unit_tests.xml --cov . --cov-config .coveragerc --cov-report term-missing --cov-report xml:reports/coverage_unit.xml
ifeq ($(IN_GITHUB_ACTION),1)
make clean
endif

.PHONY: test-functional
test-functional: clean
mkdir -p reports
py.test -s tests/functional --junitxml=reports/report_func_tests.xml --cov . --cov-config .coveragerc --cov-report term-missing --cov-report xml:reports/coverage_unit.xml
py.test -s tests/functional --junitxml=reports/report_func_tests.xml --cov . --cov-config .coveragerc --cov-report term-missing --cov-report xml:reports/coverage_func.xml
ifeq ($(IN_GITHUB_ACTION),1)
make clean
endif

.PHONY: test
test: test-integration test-unit test-functional
Expand All @@ -63,7 +78,7 @@ clean:
.PHONY: set-version
set-version:
ifneq ($(SET_ALPHA_VERSION), 0)
bash -c "sed -i \"s@_VERSION[ ]*=[ ]*[\\\"\'][0-9]\+\\.[0-9]\+\\.[0-9]\+[\\\"\'].*@_VERSION = \\\"$(PKG_VERSION)\\\"@\" setup.py"
bash -c "sed -i \"s@_VERSION[ ]*=[ ]*[\\\"\'][0-9]\+\\.[0-9]\+\\.[0-9]\+\(rc[0-9]\+\)\?[\\\"\'].*@_VERSION = \\\"$(PKG_VERSION)\\\"@\" setup.py"
endif

.PHONY: get-version
Expand Down
8 changes: 8 additions & 0 deletions changelogs/1.1.1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# [1.1.1] - 2019-10-15

## Changed

- Github actions worflow. There is now only one.
- xenon updated to 0.7.0
- pytest updated to 5.2.1
- pytest-cov updated to 2.8.1
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
"asynctest==0.13.0",
"pytz",
"pylint==2.4.2",
"xenon==0.6.0",
"xenon==0.7.0",
"black==19.3b0",
"isort==4.3.21",
]

_VERSION = "1.1.0"
_VERSION = "1.1.1"

_PACKAGES = find_packages(exclude=["tests*"])

Expand Down

0 comments on commit fc58d0a

Please sign in to comment.