Skip to content

Commit 46a1179

Browse files
authored
ci: more speed (#752)
* ci: more speed Signed-off-by: Henry Schreiner <henryfs@princeton.edu> * Apply suggestion from @henryiii * Apply suggestion from @henryiii --------- Signed-off-by: Henry Schreiner <henryfs@princeton.edu>
1 parent 77d55bb commit 46a1179

3 files changed

Lines changed: 43 additions & 11 deletions

File tree

.gitignore

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ coverage.xml
4848
*.cover
4949
*.py,cover
5050
.hypothesis/
51-
.pytest_cache/
5251
cover/
5352

5453
# Translations
@@ -124,7 +123,6 @@ venv.bak/
124123
/site
125124

126125
# mypy
127-
.mypy_cache/
128126
.dmypy.json
129127
dmypy.json
130128

@@ -165,3 +163,22 @@ _readthedocs
165163
# Jekyll build artifacts
166164
vendor/
167165
.bundle/
166+
167+
# General
168+
.DS_Store
169+
170+
# Caches
171+
.*_cache/
172+
173+
# OS specific stuff
174+
.DS_Store
175+
.DS_Store?
176+
._*
177+
.Spotlight-V100
178+
.Trashes
179+
ehthumbs.db
180+
Thumbs.db
181+
182+
# Common editor files
183+
*~
184+
*.swp

{{cookiecutter.project_name}}/.github/workflows/ci.yml

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,29 +18,33 @@ env:
1818
FORCE_COLOR: 3
1919

2020
jobs:
21-
pre-commit:
21+
lint:
2222
name: Format
2323
runs-on: ubuntu-latest
2424
steps:
2525
- uses: actions/checkout@v6
26+
{%- if cookiecutter.vcs %}
2627
with:
2728
fetch-depth: 0
29+
{%- endif %}
30+
2831
- uses: actions/setup-python@v6
2932
with:
3033
python-version: "3.x"
3134

3235
- uses: astral-sh/setup-uv@v7
3336

34-
- uses: pre-commit/action@v3.0.1
35-
with:
36-
extra_args: --hook-stage manual --all-files
37+
- uses: j178/prek-action@v2
38+
3739
- name: Run Pylint
3840
run: uvx nox -s pylint -- --output-format=github
3941

4042
checks:
4143
name: {% raw %}Check Python ${{ matrix.python-version }} on ${{ matrix.runs-on }}{% endraw %}
4244
runs-on: {% raw %}${{ matrix.runs-on }}{% endraw %}
43-
needs: [pre-commit]
45+
{%- if cookiecutter.__type == "compiled" %}
46+
needs: [lint]
47+
{%- endif %}
4448
strategy:
4549
fail-fast: false
4650
matrix:
@@ -53,8 +57,10 @@ jobs:
5357

5458
steps:
5559
- uses: actions/checkout@v6
60+
{%- if cookiecutter.vcs %}
5661
with:
5762
fetch-depth: 0
63+
{%- endif %}
5864

5965
- uses: actions/setup-python@v6
6066
with:
@@ -83,3 +89,14 @@ jobs:
8389
uses: codecov/codecov-action@v5
8490
with:
8591
token: {% raw %}${{ secrets.CODECOV_TOKEN }}{% endraw %}
92+
93+
pass:
94+
if: always()
95+
needs: [lint, checks]
96+
runs-on: ubuntu-slim
97+
timeout-minutes: 2
98+
steps:
99+
- name: Decide whether the needed jobs succeeded or failed
100+
uses: re-actors/alls-green@release/v1
101+
with:
102+
jobs: {% raw %}${{ toJSON(needs) }}{% endraw %}

{{cookiecutter.project_name}}/.gitignore

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ coverage.xml
4848
*.cover
4949
*.py,cover
5050
.hypothesis/
51-
.pytest_cache/
5251
cover/
5352

5453
# Translations
@@ -147,7 +146,6 @@ venv.bak/
147146
/site
148147

149148
# mypy
150-
.mypy_cache/
151149
.dmypy.json
152150
dmypy.json
153151

@@ -171,8 +169,8 @@ cython_debug/
171169
src/*/_version.py
172170

173171

174-
# ruff
175-
.ruff_cache/
172+
# Caches
173+
.*_cache/
176174

177175
# OS specific stuff
178176
.DS_Store

0 commit comments

Comments
 (0)