Skip to content

Commit 1bbc501

Browse files
committed
Set up CI using GitHub Actions
This ports our Travis CI setup to GitHub Actions, and also adds CI for Python 3.8 and 3.9. 3.10 was not added as it is broken due to deprecated '#' formats. 3.4 was dropped as it's not available on Ubuntu 20.04.
1 parent 5c092bd commit 1bbc501

File tree

2 files changed

+79
-64
lines changed

2 files changed

+79
-64
lines changed

.github/workflows/ci.yml

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
name: ci
2+
3+
on:
4+
pull_request:
5+
branches: [master]
6+
7+
jobs:
8+
build:
9+
name: python-${{ matrix.version }}
10+
runs-on: ubuntu-latest
11+
12+
strategy:
13+
matrix:
14+
include:
15+
- version: "2.7"
16+
- version: "3.5"
17+
- version: "3.6"
18+
- version: "3.8"
19+
- version: "3.9"
20+
# TODO(robinlinden): Fix PY_SSIZE_T_CLEAN errors.
21+
# - version: "3.10"
22+
23+
steps:
24+
- uses: actions/checkout@v2
25+
- uses: actions/setup-python@v2
26+
with:
27+
python-version: ${{ matrix.version }}
28+
- name: Install
29+
run: |
30+
sudo apt update
31+
sudo apt install -y --no-install-recommends --no-install-suggests libtoxcore-dev
32+
- name: Build
33+
run: python setup.py build_ext --inplace
34+
- name: Test
35+
run: PYTHONPATH=. python tests/tests.py
36+
37+
coverage:
38+
name: python-3.7-coverage
39+
runs-on: ubuntu-latest
40+
41+
steps:
42+
- uses: actions/checkout@v2
43+
- uses: actions/setup-python@v2
44+
with:
45+
python-version: "3.7"
46+
- name: Install
47+
run: |
48+
sudo apt update
49+
sudo apt install -y --no-install-recommends --no-install-suggests libtoxcore-dev
50+
- name: Build
51+
run: |
52+
export CFLAGS="-fprofile-arcs -ftest-coverage"
53+
python setup.py build_ext --inplace
54+
- name: Test
55+
run: PYTHONPATH=. python tests/tests.py
56+
- name: Upload coverage
57+
run: bash <(curl -s https://codecov.io/bash)
58+
59+
docker:
60+
runs-on: ubuntu-latest
61+
62+
steps:
63+
- uses: actions/checkout@v2
64+
- name: Build
65+
run: docker build -t pytox .
66+
67+
clang-analyze:
68+
runs-on: ubuntu-latest
69+
70+
steps:
71+
- uses: actions/checkout@v2
72+
- name: Install
73+
run: |
74+
sudo apt update
75+
sudo apt install -y --no-install-recommends --no-install-suggests libtoxcore-dev
76+
- name: Build
77+
run: |
78+
clang -fsyntax-only pytox/*.c -Werror -Weverything -Wno-reserved-id-macro -Wno-documentation-deprecated-sync -Wno-shorten-64-to-32 -Wno-unused-parameter -Wno-missing-field-initializers -Wno-sign-conversion -Wno-padded -Wno-conversion $(pkg-config --cflags-only-I python3)
79+
clang --analyze pytox/*.c $(pkg-config --cflags-only-I python3)

.travis.yml

Lines changed: 0 additions & 64 deletions
This file was deleted.

0 commit comments

Comments
 (0)