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

Commit d36393f

Browse files
RatanShreshthapquentin
authored andcommitted
Use GitHub Actions for macOS CI (#189)
1 parent 0e25deb commit d36393f

File tree

3 files changed

+126
-60
lines changed

3 files changed

+126
-60
lines changed

.github/workflows/ci.yml

+98-25
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,111 @@
1+
---
12
name: CI
23

34
on: [push, pull_request]
45

56
jobs:
6-
Windows:
7+
lint:
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- name: Checkout Repository
12+
uses: actions/checkout@v1
13+
- name: Set up Python 3.7
14+
uses: actions/setup-python@v1
15+
with:
16+
python-version: 3.7
17+
- name: Install dependencies
18+
run: |
19+
python3.7 -m pip install nox
20+
- name: Lint the code
21+
run: nox -s lint
22+
23+
docs:
24+
runs-on: ubuntu-latest
25+
26+
steps:
27+
- name: Checkout Repository
28+
uses: actions/checkout@v1
29+
- name: Set up Python 3.7
30+
uses: actions/setup-python@v1
31+
with:
32+
python-version: 3.7
33+
- name: Install dependencies
34+
run: |
35+
python3.7 -m pip install nox
36+
- name: Build the docs
37+
run: nox -s docs
38+
39+
macOS:
40+
runs-on: macos-latest
41+
42+
strategy:
43+
fail-fast: false
44+
matrix:
45+
python-version: [2.7, 3.5, 3.6, 3.7, 3.8]
746

47+
steps:
48+
- name: Checkout Repository
49+
uses: actions/checkout@v1
50+
- name: Set Up Python 3.7 to run nox
51+
uses: actions/setup-python@v1
52+
with:
53+
python-version: 3.7
54+
- name: Set Up Python - ${{ matrix.python-version }}
55+
if: matrix.python_version != '3.7'
56+
uses: actions/setup-python@v1
57+
with:
58+
python-version: ${{ matrix.python-version }}
59+
- name: Install Dependencies
60+
run: |
61+
python3.7 -m pip install --upgrade nox
62+
- name: Run Tests
63+
run: |
64+
nox -s test-${{ matrix.python-version }}
65+
- name: Upload Coverage
66+
uses: codecov/codecov-action@v1
67+
with:
68+
token: 3bb38a90-137e-4efe-9627-ca66de472c13
69+
file: ./coverage.xml
70+
flags: unittests
71+
name: codecov-umbrella
72+
yml: ./codecov.yml
73+
fail_ci_if_error: true
74+
75+
Windows:
876
runs-on: windows-latest
77+
978
strategy:
1079
fail-fast: false
1180
matrix:
1281
python-version: [2.7, 3.5, 3.6, 3.7, 3.8]
1382

1483
steps:
15-
- uses: actions/checkout@v1
16-
- name: Set up Python 3.7 to run nox
17-
uses: actions/setup-python@v1
18-
with:
19-
python-version: 3.7
20-
- name: Set up Python ${{ matrix.python-version }}
21-
if: matrix.python_version != '3.7'
22-
uses: actions/setup-python@v1
23-
with:
24-
python-version: ${{ matrix.python-version }}
25-
- name: Install dependencies
26-
run: |
27-
# Work around https://github.com/theacodes/nox/issues/250
28-
Remove-Item C:\ProgramData\Chocolatey\bin\python2.7.exe
29-
py -3.7 -m pip install nox
30-
- name: Test
31-
run: |
32-
nox -s test-${{ matrix.python-version }}
33-
- name: Coverage upload
34-
env:
35-
CODECOV_TOKEN: 3bb38a90-137e-4efe-9627-ca66de472c13
36-
run: |
37-
python.exe -m pip install codecov
38-
python.exe -m codecov -f coverage.xml
84+
- name: Checkout Repository
85+
uses: actions/checkout@v1
86+
- name: Set Up Python 3.7 to run nox
87+
uses: actions/setup-python@v1
88+
with:
89+
python-version: 3.7
90+
- name: Set Up Python - ${{ matrix.python-version }}
91+
if: matrix.python_version != '3.7'
92+
uses: actions/setup-python@v1
93+
with:
94+
python-version: ${{ matrix.python-version }}
95+
- name: Install dependencies (Windows)
96+
run: |
97+
# Work around https://github.com/theacodes/nox/issues/250
98+
Remove-Item C:\ProgramData\Chocolatey\bin\python2.7.exe
99+
py -3.7 -m pip install nox
100+
- name: Run Tests
101+
run: |
102+
nox -s test-${{ matrix.python-version }}
103+
- name: Upload Coverage
104+
uses: codecov/codecov-action@v1
105+
with:
106+
token: 3bb38a90-137e-4efe-9627-ca66de472c13
107+
file: ./coverage.xml
108+
flags: unittests
109+
name: codecov-umbrella
110+
yml: ./codecov.yml
111+
fail_ci_if_error: true

.github/workflows/publish.yml

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
name: Publish To PYPI
3+
4+
on:
5+
release:
6+
types: [created]
7+
8+
jobs:
9+
deploy:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v1
13+
- name: Set up Python
14+
uses: actions/setup-python@v1
15+
with:
16+
python-version: "3.x"
17+
- name: Install dependencies
18+
run: |
19+
python -m pip install --upgrade pip
20+
pip install setuptools wheel twine
21+
- name: Build and publish
22+
env:
23+
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
24+
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
25+
run: |
26+
python setup.py sdist bdist_wheel
27+
twine upload dist/*

.travis.yml

+1-35
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,6 @@ env:
3131

3232
matrix:
3333
include:
34-
# Lint & documentation.
35-
- python: 3.6
36-
env: NOX_SESSION=lint
37-
- python: 3.6
38-
env: NOX_SESSION=docs
39-
4034
# Unit tests
4135
- python: 2.7
4236
env: NOX_SESSION=test-2.7
@@ -58,34 +52,6 @@ matrix:
5852
- python: 3.7
5953
env: NOX_SESSION=google_brotli-3
6054

61-
# OS X unit tests.
62-
- language: generic
63-
os: osx
64-
env: NOX_SESSION=test-2.7
65-
- language: generic
66-
os: osx
67-
env: NOX_SESSION=test-3.5
68-
- language: generic
69-
os: osx
70-
env: NOX_SESSION=test-3.6
71-
- language: generic
72-
os: osx
73-
env: NOX_SESSION=test-3.7
74-
75-
- python: 3.7
76-
stage: deploy
77-
script:
78-
- ./_travis/deploy.sh
79-
80-
allow_failures:
81-
# MacPython 3.5 only supports TLS 1.1 by default, which fails whenever
82-
# easy_install fetchs packages, which is required by Twisted. Giving up on
83-
# testing MacPython 3.5 on Travis for this reason.
84-
# https://github.com/tox-dev/tox/issues/809#issuecomment-443436586
85-
- language: generic
86-
os: osx
87-
env: NOX_SESSION=test-3.5
88-
8955
stages:
9056
- name: test
9157
if: tag IS blank
@@ -96,4 +62,4 @@ stages:
9662

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

0 commit comments

Comments
 (0)