Skip to content

Commit

Permalink
CI: Switch to GitHub Actions
Browse files Browse the repository at this point in the history
Because Travis CI is dead.
  • Loading branch information
adrienverge committed Mar 16, 2021
1 parent 8f68248 commit 66bf76a
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 25 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
---

name: CI

on: # yamllint disable-line rule:truthy
push:
pull_request:
branches:
- master

jobs:
lint:
name: Linters
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.9
- run: python -m pip install flake8 flake8-import-order doc8 sphinx
- run: python -m pip install .
- run: flake8 .
- run: doc8 $(git ls-files '*.rst')
- run: yamllint --strict $(git ls-files '*.yaml' '*.yml')
- run: python setup.py build_sphinx

test:
name: Tests
runs-on: ubuntu-latest
strategy:
matrix:
python-version:
- 3.5
- 3.6
- 3.7
- 3.8
- 3.9
- nightly
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Python ${{ matrix.pyver }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.pyver }}
- run: python -m pip install coveralls
- run: python -m pip install .
- run: coverage run --source=yamllint -m unittest discover
- name: Coveralls
uses: AndreMiras/coveralls-python-action@develop
25 changes: 0 additions & 25 deletions .travis.yml

This file was deleted.

3 changes: 3 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,6 @@ yamllint = conf/*.yaml
[options.entry_points]
console_scripts =
yamllint = yamllint.cli:run

[coverage:run]
relative_files = True
1 change: 1 addition & 0 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,7 @@ def test_run_with_config_file(self):
cli.run(('-c', f.name, os.path.join(self.wd, 'a.yaml')))
self.assertEqual(ctx.returncode, 1)

@unittest.skipIf(os.environ.get('GITHUB_RUN_ID'), '$HOME not overridable')
def test_run_with_user_global_config_file(self):
home = os.path.join(self.wd, 'fake-home')
dir = os.path.join(home, '.config', 'yamllint')
Expand Down

0 comments on commit 66bf76a

Please sign in to comment.