Skip to content

Commit edaec9a

Browse files
committed
Using action for pre-commit
1 parent c0f80c6 commit edaec9a

File tree

2 files changed

+13
-18
lines changed

2 files changed

+13
-18
lines changed

.github/workflows/tests.yml

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,24 +9,16 @@ on:
99
- master
1010

1111
jobs:
12-
formatting:
12+
pre-commit:
1313
name: Formatting
1414
runs-on: ubuntu-latest
15-
1615
steps:
17-
- uses: actions/checkout@v1
18-
- uses: actions/setup-python@v1
19-
with:
20-
python-version: '3.7'
21-
architecture: 'x64'
22-
23-
- name: Install pre-commit
24-
run: python -m pip install pre-commit
25-
26-
- name: Run pre-commit
27-
run: pre-commit run --all
28-
29-
- name: Display format changes
30-
run: git diff --exit-code
31-
if: always()
32-
16+
- uses: actions/checkout@v1
17+
- uses: actions/setup-python@v1
18+
- name: set PY
19+
run: echo "::set-env name=PY::$(python --version --version | sha256sum | cut -d' ' -f1)"
20+
- uses: actions/cache@v1
21+
with:
22+
path: ~/.cache/pre-commit
23+
key: pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }}
24+
- uses: pre-commit/action@v1.0.0

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
[![Build Status Linux and macOS][travis-badge]][travis]
66
[![Build Status Windows][appveyor-badge]][appveyor]
77
[![Build Status Azure][azure-badge]][azure]
8+
[![Actions Status][actions-badge]][actions-link]
89
[![Code Coverage][codecov-badge]][codecov]
910
[![Codacy Badge][codacy-badge]][codacy-link]
1011
[![Join the chat at https://gitter.im/CLI11gitter/Lobby][gitter-badge]][gitter]
@@ -870,6 +871,8 @@ CLI11 was developed at the [University of Cincinnati][] to support of the [GooFi
870871
[travis]: https://travis-ci.org/CLIUtils/CLI11
871872
[appveyor-badge]: https://img.shields.io/appveyor/ci/HenrySchreiner/cli11/master.svg?label=Windows
872873
[appveyor]: https://ci.appveyor.com/project/HenrySchreiner/cli11
874+
[actions-badge]: https://github.com/CLIUtils/CLI11/workflows/Tests/badge.svg
875+
[actions-link]: https://github.com/CLIUtils/CLI11/actions
873876
[codecov-badge]: https://codecov.io/gh/CLIUtils/CLI11/branch/master/graph/badge.svg
874877
[codecov]: https://codecov.io/gh/CLIUtils/CLI11
875878
[gitter-badge]: https://badges.gitter.im/CLI11gitter/Lobby.svg

0 commit comments

Comments
 (0)