Skip to content

Commit b1ff514

Browse files
committed
2 parents dd9b6d6 + 8a3864e commit b1ff514

2 files changed

Lines changed: 24 additions & 14 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,14 @@
11
name: CI
22

3-
####################################
4-
# Start the job on all push and PR #
5-
####################################
63
on:
7-
pull_request:
4+
pull_request: # Start the job on all PRs
85
branches: [master, main]
96
types: [synchronize, opened, reopened, ready_for_review]
107
push: # Start the job on all main branch push
118
branches: [master, main]
129

1310
jobs:
14-
precommits:
11+
precommit:
1512
runs-on: ubuntu-latest
1613

1714
steps:
@@ -27,30 +24,41 @@ jobs:
2724
uses: actions/cache@v3
2825
with:
2926
path: ~/.cache/pip
30-
# key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
3127
key: ${{ runner.os }}-pip-
3228
restore-keys: |
3329
${{ runner.os }}-pip-
3430
35-
- name: Install dependencies
36-
run: |
37-
python -m pip install pre-commit
38-
pre-commit install
39-
4031
- name: Cache shfmt binary
4132
uses: actions/cache@v3
4233
with:
4334
path: /usr/local/bin/shfmt
4435
# key: ${{ runner.os }}-shfmt-${{ env.SHFMT_VERSION }}
4536
key: ${{ runner.os }}-shfmt-
4637

38+
- name: Cache Pre-Commit environments
39+
uses: actions/cache@v3
40+
with:
41+
path: ~/.cache/pre-commit
42+
# key: ${{ runner.os }}-pc-${{ hashFiles('.pre-commit-config.yaml') }}
43+
key: ${{ runner.os }}-pc-
44+
restore-keys: |
45+
${{ runner.os }}-pc-
46+
47+
- name: Install dependencies
48+
run: |
49+
python -m pip install pre-commit
50+
pre-commit install
51+
4752
- name: Install shfmt
4853
run: |
4954
SHFMT_VERSION="v3.7.0"
5055
SHFMT_BIN="shfmt_${SHFMT_VERSION}_linux_amd64"
51-
wget -O shfmt "https://github.com/mvdan/sh/releases/download/${SHFMT_VERSION}/${SHFMT_BIN}"
52-
chmod +x shfmt
53-
sudo mv shfmt /usr/local/bin/
56+
if [[ ! -f /usr/local/bin/shfmt ]]; then
57+
wget -O shfmt "https://github.com/mvdan/sh/releases/download/${SHFMT_VERSION}/${SHFMT_BIN}"
58+
chmod +x shfmt
59+
sudo mv shfmt /usr/local/bin/
60+
fi
61+
sudo apt-get install shellcheck
5462
5563
- name: Run pre-commits
5664
run: |

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66

77
`cpa` is a cli tool for ultra fast setup of new Python projects. It automates the creation of config files for style & lint checks, gitignore, a basic Dockerfile and Poetry for dependency management. An opinionated set of pre-commit hooks are included for enforcing best practices and reducing dev time.
88

9+
An example output is provided in [./example](https://github.com/ysawa0/create-python-app/tree/main/example)
10+
911
## Installation
1012

1113
### MacOS, Linux

0 commit comments

Comments
 (0)