Skip to content

Commit

Permalink
Using action for pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
henryiii committed Nov 29, 2019
1 parent b1ef507 commit 1b1b76b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 18 deletions.
28 changes: 10 additions & 18 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,16 @@ on:
- master

jobs:
formatting:
pre-commit:
name: Formatting
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- uses: actions/setup-python@v1
with:
python-version: '3.7'
architecture: 'x64'

- name: Install pre-commit
run: python -m pip install pre-commit

- name: Run pre-commit
run: pre-commit run --all

- name: Display format changes
run: git diff --exit-code
if: always()

- uses: actions/checkout@v1
- uses: actions/setup-python@v1
- name: set PY
run: echo "::set-env name=PY::$(python --version --version | sha256sum | cut -d' ' -f1)"
- uses: actions/cache@v1
with:
path: ~/.cache/pre-commit
key: pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }}
- uses: pre-commit/[email protected]
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
[![Build Status Linux and macOS][travis-badge]][travis]
[![Build Status Windows][appveyor-badge]][appveyor]
[![Build Status Azure][azure-badge]][azure]
[![Actions Status][actions-badge]][actions-link]
[![Code Coverage][codecov-badge]][codecov]
[![Codacy Badge][codacy-badge]][codacy-link]
[![Join the chat at https://gitter.im/CLI11gitter/Lobby][gitter-badge]][gitter]
Expand Down Expand Up @@ -870,6 +871,8 @@ CLI11 was developed at the [University of Cincinnati][] to support of the [GooFi
[travis]: https://travis-ci.org/CLIUtils/CLI11
[appveyor-badge]: https://img.shields.io/appveyor/ci/HenrySchreiner/cli11/master.svg?label=Windows
[appveyor]: https://ci.appveyor.com/project/HenrySchreiner/cli11
[actions-badge]: https://github.com/CLIUtils/CLI11/workflows/Tests/badge.svg
[actions-link]: https://github.com/CLIUtils/CLI11/actions
[codecov-badge]: https://codecov.io/gh/CLIUtils/CLI11/branch/master/graph/badge.svg
[codecov]: https://codecov.io/gh/CLIUtils/CLI11
[gitter-badge]: https://badges.gitter.im/CLI11gitter/Lobby.svg
Expand Down

0 comments on commit 1b1b76b

Please sign in to comment.