Skip to content

Commit

Permalink
Add GitHub Actions workflow for testing and checking (#282)
Browse files Browse the repository at this point in the history
* Add .github/workflows/ci.yml

* quote as - "*"

* remove unused checks: job

* oh well

* fixup displaying python info

* correct job names

* add missing )

* remove workflow name

* rename as CI because it's short

* fix checks matrix definition

* fail-fast: false

* drop the tox --notest after install

* it is tests

* just get all the history

* with

* add empty misc newsfragment

* try out twisted/python-info-action

* try updated twisted/python-info-action

* remove pip cache setup from workflow

* separate to two test and check jobs

* add flake8, check-manifest, and check-newsfragment to tox envlist

* misc visual tidying of workflow yaml

* use ubuntu-latest

* even littler visual tidying of workflow yaml

* use twisted/python-info-action@v1

* Update .github/workflows/ci.yml

Co-authored-by: Adi Roiban <adiroiban@gmail.com>

* use twisted/python-info-action@v1.0.1

Co-authored-by: Adi Roiban <adiroiban@gmail.com>
  • Loading branch information
altendky and adiroiban committed Dec 2, 2020
1 parent 5c43102 commit 0df024e
Show file tree
Hide file tree
Showing 3 changed files with 100 additions and 1 deletion.
99 changes: 99 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
name: CI

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
test:
name: ${{ matrix.task.name}} - ${{ matrix.python.name }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python:
- name: CPython 2.7
tox: py27
action: 2.7
- name: CPython 3.5
tox: py35
action: 3.5
- name: CPython 3.6
tox: py36
action: 3.6
- name: CPython 3.7
tox: py37
action: 3.7
task:
- name: Test
tox: tests

steps:
- uses: actions/checkout@v2

- name: Set up ${{ matrix.python.name }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python.action }}

- uses: twisted/python-info-action@v1.0.1

- name: Install dependencies
run: python -m pip install --upgrade pip tox

- name: Test
run: tox -c tox.ini -e ${{ matrix.python.tox }}-tests

- name: Codecov
run: |
curl -o codecov.sh https://codecov.io/bash
bash codecov.sh -n "GitHub Actions - ${{ matrix.task.name}} - ${{ matrix.python.name }}"
check:
name: ${{ matrix.task.name}} - ${{ matrix.python.name }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python:
- name: CPython 3.6
tox: py36
action: 3.6
task:
- name: Flake8
tox: flake8
- name: Check Manifest
tox: check-manifest
- name: Check Newsfragment
tox: check-newsfragment

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Set up ${{ matrix.python.name }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python.action }}

- uses: twisted/python-info-action@v1.0.1

- name: Install dependencies
run: python -m pip install --upgrade pip tox

- name: Check
run: tox -c tox.ini -e ${{ matrix.python.tox }}-${{ matrix.task.tox }}

all:
name: All
runs-on: ubuntu-latest
needs:
- test
- check
steps:
- name: This
shell: python
run: import this
Empty file.
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = cov-erase, flake8, {pypy3,py27,py35,py36,py37}-tests, cov-report
envlist = cov-erase, flake8, {pypy3,py27,py35,py36,py37}-{tests,flake8,check-manifest,check-newsfragment}, cov-report
skip_missing_envs = true

[testenv:flake8]
Expand Down

0 comments on commit 0df024e

Please sign in to comment.