Skip to content

Commit

Permalink
Merge pull request #7954 from pradyunsg/simplify-linting-github-action
Browse files Browse the repository at this point in the history
Simplify our Linting GitHub Action
  • Loading branch information
pradyunsg committed Apr 2, 2020
2 parents 2a1f3c2 + 28389e8 commit f6457b7
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 97 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Linting

on:
push:
pull_request:
schedule:
# Run every Friday at 18:02 UTC
- cron: 2 18 * * 5

jobs:
lint:
name: ${{ matrix.os }}
runs-on: ${{ matrix.os }}-latest
env:
TOXENV: lint,docs,vendoring

strategy:
matrix:
os:
- Ubuntu
- Windows
- MacOS

steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v1
with:
python-version: 3.8

# Setup Caching
- name: pip cache
uses: actions/cache@v1
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('tools/requirements/tests.txt') }}-${{ hashFiles('tools/requirements/docs.txt') }}-${{ hashFiles('tox.ini') }}
restore-keys: |
${{ runner.os }}-pip-
${{ runner.os }}-
- name: Set PY (for pre-commit cache)
run: echo "::set-env name=PY::$(python -c 'import hashlib, sys;print(hashlib.sha256(sys.version.encode()+sys.executable.encode()).hexdigest())')"
- name: pre-commit cache
uses: actions/cache@v1
with:
path: ~/.cache/pre-commit
key: pre-commit|2020-02-14|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }}

# Get the latest tox
- name: Install tox
run: python -m pip install tox

# Main check
- run: python -m tox
97 changes: 0 additions & 97 deletions .github/workflows/python-linters.yml

This file was deleted.

0 comments on commit f6457b7

Please sign in to comment.