Skip to content
This repository was archived by the owner on Apr 14, 2022. It is now read-only.

Add gh actions for CI on macos #189

Merged
merged 6 commits into from
Dec 12, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
123 changes: 98 additions & 25 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,38 +1,111 @@
---
name: CI

on: [push, pull_request]

jobs:
Windows:
lint:
runs-on: ubuntu-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v1
- name: Set up Python 3.7
uses: actions/setup-python@v1
with:
python-version: 3.7
- name: Install dependencies
run: |
python3.7 -m pip install nox
- name: Lint the code
run: nox -s lint

docs:
runs-on: ubuntu-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v1
- name: Set up Python 3.7
uses: actions/setup-python@v1
with:
python-version: 3.7
- name: Install dependencies
run: |
python3.7 -m pip install nox
- name: Build the docs
run: nox -s docs

macOS:
runs-on: macos-latest

strategy:
fail-fast: false
matrix:
python-version: [2.7, 3.5, 3.6, 3.7, 3.8]

steps:
- name: Checkout Repository
uses: actions/checkout@v1
- name: Set Up Python 3.7 to run nox
uses: actions/setup-python@v1
with:
python-version: 3.7
- name: Set Up Python - ${{ matrix.python-version }}
if: matrix.python_version != '3.7'
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install Dependencies
run: |
python3.7 -m pip install --upgrade nox
- name: Run Tests
run: |
nox -s test-${{ matrix.python-version }}
- name: Upload Coverage
uses: codecov/codecov-action@v1
with:
token: 3bb38a90-137e-4efe-9627-ca66de472c13
file: ./coverage.xml
flags: unittests
name: codecov-umbrella
yml: ./codecov.yml
fail_ci_if_error: true

Windows:
runs-on: windows-latest

strategy:
fail-fast: false
matrix:
python-version: [2.7, 3.5, 3.6, 3.7, 3.8]

steps:
- uses: actions/checkout@v1
- name: Set up Python 3.7 to run nox
uses: actions/setup-python@v1
with:
python-version: 3.7
- name: Set up Python ${{ matrix.python-version }}
if: matrix.python_version != '3.7'
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
# Work around https://github.com/theacodes/nox/issues/250
Remove-Item C:\ProgramData\Chocolatey\bin\python2.7.exe
py -3.7 -m pip install nox
- name: Test
run: |
nox -s test-${{ matrix.python-version }}
- name: Coverage upload
env:
CODECOV_TOKEN: 3bb38a90-137e-4efe-9627-ca66de472c13
run: |
python.exe -m pip install codecov
python.exe -m codecov -f coverage.xml
- name: Checkout Repository
uses: actions/checkout@v1
- name: Set Up Python 3.7 to run nox
uses: actions/setup-python@v1
with:
python-version: 3.7
- name: Set Up Python - ${{ matrix.python-version }}
if: matrix.python_version != '3.7'
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies (Windows)
run: |
# Work around https://github.com/theacodes/nox/issues/250
Remove-Item C:\ProgramData\Chocolatey\bin\python2.7.exe
py -3.7 -m pip install nox
- name: Run Tests
run: |
nox -s test-${{ matrix.python-version }}
- name: Upload Coverage
uses: codecov/codecov-action@v1
with:
token: 3bb38a90-137e-4efe-9627-ca66de472c13
file: ./coverage.xml
flags: unittests
name: codecov-umbrella
yml: ./codecov.yml
fail_ci_if_error: true
27 changes: 27 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
name: Publish To PYPI

on:
release:
types: [created]

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: "3.x"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*
36 changes: 1 addition & 35 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,6 @@ env:

matrix:
include:
# Lint & documentation.
- python: 3.6
env: NOX_SESSION=lint
- python: 3.6
env: NOX_SESSION=docs

# Unit tests
- python: 2.7
env: NOX_SESSION=test-2.7
Expand All @@ -58,34 +52,6 @@ matrix:
- python: 3.7
env: NOX_SESSION=google_brotli-3

# OS X unit tests.
- language: generic
os: osx
env: NOX_SESSION=test-2.7
- language: generic
os: osx
env: NOX_SESSION=test-3.5
- language: generic
os: osx
env: NOX_SESSION=test-3.6
- language: generic
os: osx
env: NOX_SESSION=test-3.7

- python: 3.7
stage: deploy
script:
- ./_travis/deploy.sh

allow_failures:
# MacPython 3.5 only supports TLS 1.1 by default, which fails whenever
# easy_install fetchs packages, which is required by Twisted. Giving up on
# testing MacPython 3.5 on Travis for this reason.
# https://github.com/tox-dev/tox/issues/809#issuecomment-443436586
- language: generic
os: osx
env: NOX_SESSION=test-3.5

stages:
- name: test
if: tag IS blank
Expand All @@ -96,4 +62,4 @@ stages:

# Deploy on any tags
- name: deploy
if: tag IS present AND tag =~ /^(\d+\.\d+(?:.\d+)?)$/ AND repo = hip/hip
if: tag IS present AND tag =~ /^(\d+\.\d+(?:.\d+)?)$/ AND repo = hip/hip