Skip to content

Commit

Permalink
Merge pull request #45 from tk0miya/github_actions
Browse files Browse the repository at this point in the history
Do test in GitHub Actions
  • Loading branch information
tk0miya committed Mar 15, 2021
2 parents eacbf3f + d494def commit 0d59000
Show file tree
Hide file tree
Showing 3 changed files with 79 additions and 30 deletions.
70 changes: 70 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Test
on: [push, pull_request]

jobs:
tests:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.5, 3.6, 3.7]
max-parallel: 1

steps:
- name: Print github context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo $GITHUB_CONTEXT

- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 1

- name: pycache
uses: actions/cache@v2
id: pycache
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Setup python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Install tox and test related
run: |
python -m pip install --upgrade pip
pip install tox tox-gh-actions
- name: Run tox
run: |
python -V
tox -- -v --durations=25
lint:
runs-on: ubuntu-latest
strategy:
matrix:
env: [flake8]

steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 1

- name: Setup python
uses: actions/setup-python@v2
with:
python-version: 3.8

- name: Install tox and any other dependencies for test
run: |
python -m pip install --upgrade pip
pip install tox tox-gh-actions
- name: Run tox
run: tox -e ${{ matrix.env }}
29 changes: 0 additions & 29 deletions .travis.yml

This file was deleted.

10 changes: 9 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
[tox]
envlist=py37,py36,py35,flake8,sdist
envlist =
py{35,36,37},
flake8

[gh-actions]
python =
3.5: py35
3.6: py36
3.7: py37

[testenv]
deps=-e.[transifex,test]
Expand Down

0 comments on commit 0d59000

Please sign in to comment.