mirror of
https://github.com/khornberg/octokit.py
synced 2026-05-17 00:06:59 +03:00
Merge pull request #58 from khornberg/actions
Peripheral: Remove travis
This commit is contained in:
+61
-2
@@ -5,7 +5,7 @@ workflow "Publish to PyPi" {
|
||||
]
|
||||
}
|
||||
|
||||
action "action-filter" {
|
||||
action "Master Workflow" {
|
||||
uses = "actions/bin/filter@master"
|
||||
args = "branch master"
|
||||
}
|
||||
@@ -13,7 +13,7 @@ action "action-filter" {
|
||||
action "Package" {
|
||||
uses = "khornberg/python-actions/setup-py/3.7@master"
|
||||
args = "bdist_wheel sdist"
|
||||
needs = ["action-filter"]
|
||||
needs = ["Master Workflow"]
|
||||
}
|
||||
|
||||
action "PyPi Twine Upload" {
|
||||
@@ -22,3 +22,62 @@ action "PyPi Twine Upload" {
|
||||
args = "upload dist/*"
|
||||
secrets = ["TWINE_USERNAME", "TWINE_PASSWORD"]
|
||||
}
|
||||
|
||||
# PR workflow
|
||||
|
||||
workflow "Test" {
|
||||
on = "push"
|
||||
resolves = [
|
||||
"Report", "Lint", "Docs"
|
||||
]
|
||||
}
|
||||
|
||||
action "Filter" {
|
||||
uses = "actions/bin/filter@master"
|
||||
args = "not branch master"
|
||||
}
|
||||
|
||||
action "Curl" {
|
||||
uses = "actions/bin/curl@master"
|
||||
args = "curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter"
|
||||
needs = ["Filter"]
|
||||
}
|
||||
|
||||
action "Prepare" {
|
||||
uses = "actions/bin/sh@master"
|
||||
args = ["chmod +x ./cc-test-reporter && ./cc-test-reporter before-build"]
|
||||
secrets = ["CC_TEST_REPORTER_ID"]
|
||||
needs = ["Curl"]
|
||||
}
|
||||
|
||||
action "Requirements 3.6" {
|
||||
uses = "jefftriplett/python-actions@master"
|
||||
args = "pip install tox"
|
||||
needs = ["Prepare"]
|
||||
}
|
||||
|
||||
action "Test 3.6" {
|
||||
uses = "jefftriplett/python-actions@master"
|
||||
args = "tox -e py36 -v"
|
||||
needs = ["Requirements 3.6"]
|
||||
}
|
||||
|
||||
action "Lint" {
|
||||
uses = "jefftriplett/python-actions@master"
|
||||
args = "tox -e check -v"
|
||||
needs = ["Requirements 3.6"]
|
||||
}
|
||||
|
||||
action "Docs" {
|
||||
uses = "jefftriplett/python-actions@master"
|
||||
args = "tox -e docs -v"
|
||||
needs = ["Requirements 3.6"]
|
||||
}
|
||||
|
||||
action "Report" {
|
||||
uses = "actions/bin/sh@master"
|
||||
args = ["apt-get update && apt-get install git-core -y && ./cc-test-reporter after-build --coverage-input-type coverage.py"]
|
||||
needs = ["Test 3.6"]
|
||||
secrets = ["CC_TEST_REPORTER_ID"]
|
||||
}
|
||||
|
||||
|
||||
-71
@@ -1,71 +0,0 @@
|
||||
language: python
|
||||
dist: xenial
|
||||
python:
|
||||
- '3.6'
|
||||
sudo: false
|
||||
cache: pip
|
||||
env:
|
||||
global:
|
||||
- LD_PRELOAD=/lib/x86_64-linux-gnu/libSegFault.so
|
||||
- SEGFAULT_SIGNALS=all
|
||||
matrix:
|
||||
- TOXENV=check
|
||||
- TOXENV=docs
|
||||
matrix:
|
||||
include:
|
||||
- python: '3.7'
|
||||
env:
|
||||
- TOXENV=py37
|
||||
- python: '3.6'
|
||||
env:
|
||||
- TOXENV=py36
|
||||
- python: '3.5'
|
||||
env:
|
||||
- TOXENV=py35
|
||||
before_install:
|
||||
- python --version
|
||||
- uname -a
|
||||
- lsb_release -a
|
||||
install:
|
||||
- pip install tox
|
||||
- virtualenv --version
|
||||
- easy_install --version
|
||||
- pip --version
|
||||
- tox --version
|
||||
before_script:
|
||||
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
|
||||
- chmod +x ./cc-test-reporter
|
||||
- ./cc-test-reporter before-build
|
||||
script:
|
||||
- tox -v
|
||||
after_script:
|
||||
- ./cc-test-reporter after-build --coverage-input-type coverage.py --exit-code $TRAVIS_TEST_RESULT
|
||||
after_failure:
|
||||
- more .tox/log/* | cat
|
||||
- more .tox/*/log/* | cat
|
||||
before_deploy:
|
||||
- git config --local user.name "Kyle Hornberg"
|
||||
- git config --local user.email "khornberg@users.noreply.github.com"
|
||||
- if [ ! -f .git/refs/tags/$(python ./setup.py --version) ]; then git tag $(python ./setup.py --version); fi
|
||||
- echo $(git tag -l)
|
||||
- pip install twine
|
||||
deploy:
|
||||
- provider: releases
|
||||
api_key: $KEY
|
||||
file_glob: true
|
||||
file: dist/**
|
||||
skip_cleanup: true
|
||||
on:
|
||||
branch: master
|
||||
condition: '$TRAVIS_TAG != $(python ./setup.py--version)'
|
||||
condition: '$TOXENV = py36'
|
||||
- provider: script
|
||||
script: scripts/pypi.sh
|
||||
on:
|
||||
branch: master
|
||||
condition: '$TRAVIS_TAG != $(python ./setup.py--version)'
|
||||
condition: '$TOXENV = py36'
|
||||
notifications:
|
||||
email:
|
||||
on_success: never
|
||||
on_failure: never
|
||||
+1
-1
@@ -21,4 +21,4 @@ include .pyup.yml
|
||||
include *.json
|
||||
include *.sh
|
||||
|
||||
global-exclude *.py[cod] __pycache__ *.so *.dylib
|
||||
global-exclude *.py[cod] __pycache__ *.so *.dylib .github .github/*
|
||||
|
||||
+1
-1
@@ -142,7 +142,7 @@ class TestAuth(object):
|
||||
'https://api.github.com/users/octokit/followers',
|
||||
headers={
|
||||
'Content-Type': 'application/json',
|
||||
'accept': 'application/vnd.github.v3+json'
|
||||
'accept': 'application/vnd.github.v3+json',
|
||||
},
|
||||
params={
|
||||
'page': 1,
|
||||
|
||||
@@ -233,7 +233,9 @@ class TestClientMethods(object):
|
||||
mocker.patch('requests.get')
|
||||
headers = {'accept': 'application/vnd.github.ant-man-preview+json', 'Content-Type': 'application/json'}
|
||||
Octokit().oauth_authorizations.get_authorization(
|
||||
authorization_id=100, headers={'accept': 'application/vnd.github.ant-man-preview+json'}
|
||||
authorization_id=100, headers={
|
||||
'accept': 'application/vnd.github.ant-man-preview+json'
|
||||
}
|
||||
)
|
||||
requests.get.assert_called_once_with('https://api.github.com/authorizations/100', params={}, headers=headers)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user