Skip to content

Commit

Permalink
Use actions/setup-python's pip cache and update other CI config
Browse files Browse the repository at this point in the history
  • Loading branch information
hugovk committed Feb 12, 2022
1 parent 464de59 commit 0f2ff42
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 36 deletions.
16 changes: 5 additions & 11 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,20 @@
name: Docs

on: [push, pull_request]
on: [push, pull_request, workflow_dispatch]

jobs:
build:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Cache
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: docs-${{ hashFiles('**/tox.ini') }}
restore-keys: |
docs-
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8
python-version: "3.x"
pip: cache
pip-dependency-path: tox.ini

- name: Install dependencies
run: |
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@ on:
- master
paths:
- .github/labels.yml
workflow_dispatch:

jobs:
build:
sync:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
name: Lint

on: [push, pull_request]
on: [push, pull_request, workflow_dispatch]

jobs:
lint:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: pre-commit/[email protected].2
- uses: pre-commit/[email protected].3
3 changes: 2 additions & 1 deletion .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ on:
# branches to consider in the event; optional, defaults to all
branches:
- master
workflow_dispatch:

jobs:
update_release_draft:
if: github.repository == 'jmoiron/humanize'
if: github.repository_owner == 'jmoiron'
runs-on: ubuntu-latest
steps:
# Drafts your next release notes as pull requests are merged into "master"
Expand Down
23 changes: 5 additions & 18 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
name: Test

on: [push, pull_request]
on: [push, pull_request, workflow_dispatch]

env:
FORCE_COLOR: 1

jobs:
build:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
Expand All @@ -26,21 +26,8 @@ jobs:
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Get pip cache dir
id: pip-cache
run: |
echo "::set-output name=dir::$(pip cache dir)"
- name: Cache
uses: actions/cache@v2
with:
path: ${{ steps.pip-cache.outputs.dir }}
key:
${{ matrix.os }}-${{ matrix.python-version }}-v1-${{
hashFiles('**/setup.py') }}
restore-keys: |
${{ matrix.os }}-${{ matrix.python-version }}-v1-
cache: pip
cache-dependency-path: setup.cfg

- name: Install Linux dependencies
if: startsWith(matrix.os, 'ubuntu')
Expand All @@ -67,7 +54,7 @@ jobs:
tox -e py
- name: Upload coverage
uses: codecov/codecov-action@v1
uses: codecov/codecov-action@v2
with:
flags: ${{ matrix.codecov-flag }}
name: ${{ matrix.os }} Python ${{ matrix.python-version }}
7 changes: 5 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ repos:
hooks:
- id: isort

- repo: https://gitlab.com/pycqa/flake8
- repo: https://github.com/PyCQA/flake8
rev: 3.9.2
hooks:
- id: flake8
Expand Down Expand Up @@ -50,4 +50,7 @@ repos:
- repo: https://github.com/asottile/setup-cfg-fmt
rev: v1.18.0
hooks:
- id: setup-cfg-fmt
- id: setup-cfg-fmt

ci:
autoupdate_schedule: quarterly

0 comments on commit 0f2ff42

Please sign in to comment.