Skip to content

Commit eb0f91c

Browse files
committed
ci(workflows): skip duplicate runs and update configurations
Add pre-job to skip duplicate workflow runs using liblaf/actions-ts/pre action - Implemented in all workflows (bench, build, docs, release, test) - Reduces CI resource usage by preventing redundant executions - Added dist** to branches-ignore patterns Update pyright configuration - Added reportPrivateImportUsage and reportRedeclaration rules - Reordered configuration properties for consistency Refactor template files - Standardized Jinja comment syntax to use # %% for statements - Improved .gitignore organization - Added *.dvc pattern to VSCode excludes - Renamed lazy_loader import to _lazy for consistency
1 parent 94241b8 commit eb0f91c

15 files changed

Lines changed: 128 additions & 49 deletions

File tree

copier.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ _answers_file: .config/copier/.copier-answers.python.yaml
77
_external_data:
88
shared: "{{ answers_file_shared }}"
99

10+
_envops:
11+
line_statement_prefix: "# %%"
12+
line_comment_prefix: "# ##"
13+
1014
_migrations: &migrations
1115
- rm --force --verbose '__builtins__.pyi'
1216
- rm --force --verbose '.config/copier/direnv/00-python.sh'

template/.config/copier/{{ _copier_conf.answers_file }}.jinja

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# -*- mode: yaml; -*-
1+
# ## -*- mode: yaml; -*-
22
# This file is @generated by <https://github.com/liblaf/copier-python>.
33
# DO NOT EDIT!
44
# prettier-ignore
Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
{
22
"$schema": "https://raw.githubusercontent.com/microsoft/pyright/main/packages/vscode-pyright/schemas/pyrightconfig.schema.json",
3-
43
"enableTypeIgnoreComments": false,
5-
64
"typeCheckingMode": "standard",
7-
85
"reportArgumentType": "information",
96
"reportAssignmentType": "information",
10-
"reportRedeclaration": "none",
117
"reportIncompatibleMethodOverride": "warning",
12-
"reportIncompatibleVariableOverride": "warning"
8+
"reportIncompatibleVariableOverride": "warning",
9+
"reportPrivateImportUsage": "none",
10+
"reportRedeclaration": "none",
1311
}

template/.config/mise/conf.d/10-python.toml.jinja renamed to template/.config/mise/conf.d/10-python.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# -*- mode: toml -*-
21
#:schema https://mise.jdx.dev/schema/mise.json
32
# This file is @generated by <https://github.com/liblaf/copier-python>.
43
# DO NOT EDIT!

template/.github/workflows/bench.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,31 @@ on:
77
push:
88
branches-ignore:
99
- assets**
10+
- dist**
1011
- gh-pages
1112
pull_request:
1213
workflow_dispatch:
1314

1415
jobs:
16+
pre:
17+
name: Pre
18+
permissions:
19+
actions: write
20+
runs-on: ubuntu-latest
21+
outputs:
22+
should-skip: ${{ steps.pre.outputs.should-skip }}
23+
steps:
24+
- id: pre
25+
name: Skip Duplicate Actions
26+
uses: liblaf/actions-ts/pre@dist
27+
with:
28+
cancel-others: true
29+
1530
detect:
1631
name: Detect
32+
needs:
33+
- pre
34+
if: needs.pre.outputs.should-skip != 'true'
1735
runs-on: ubuntu-latest
1836
outputs:
1937
bench: ${{ steps.bench.outcome == 'success' }}

template/.github/workflows/build.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,31 @@ on:
77
push:
88
branches-ignore:
99
- assets**
10+
- dist**
1011
- gh-pages
1112
pull_request:
1213
workflow_dispatch:
1314

1415
jobs:
16+
pre:
17+
name: Pre
18+
permissions:
19+
actions: write
20+
runs-on: ubuntu-latest
21+
outputs:
22+
should-skip: ${{ steps.pre.outputs.should-skip }}
23+
steps:
24+
- id: pre
25+
name: Skip Duplicate Actions
26+
uses: liblaf/actions-ts/pre@dist
27+
with:
28+
cancel-others: true
29+
1530
build:
1631
name: Build
32+
needs:
33+
- pre
34+
if: needs.pre.outputs.should-skip != 'true'
1735
runs-on: ubuntu-latest
1836
steps:
1937
- name: Checkout

template/.github/workflows/docs.yaml

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,35 @@ on:
66
push:
77
branches-ignore:
88
- assets**
9+
- dist**
910
- gh-pages
11+
pull_request:
1012
workflow_dispatch:
1113

1214
jobs:
15+
pre:
16+
name: Pre
17+
permissions:
18+
actions: write
19+
runs-on: ubuntu-latest
20+
outputs:
21+
should-skip: ${{ steps.pre.outputs.should-skip }}
22+
steps:
23+
- id: pre
24+
name: Skip Duplicate Actions
25+
uses: liblaf/actions-ts/pre@dist
26+
with:
27+
cancel-others: true
28+
1329
docs:
1430
name: Docs
1531
permissions:
1632
contents: write
1733
pages: write
34+
needs:
35+
- pre
36+
if: needs.pre.outputs.should-skip != 'true'
1837
runs-on: ubuntu-latest
19-
concurrency:
20-
group: ${{ github.workflow }}-${{ github.ref }}-docs
21-
cancel-in-progress: true
2238
steps:
2339
- id: auth
2440
name: Auth App

template/.github/workflows/release.yaml

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,25 @@ on:
1010
workflow_dispatch:
1111

1212
jobs:
13+
pre:
14+
name: Pre
15+
permissions:
16+
actions: write
17+
runs-on: ubuntu-latest
18+
outputs:
19+
should-skip: ${{ steps.pre.outputs.should-skip }}
20+
steps:
21+
- id: pre
22+
name: Skip Duplicate Actions
23+
uses: liblaf/actions-ts/pre@dist
24+
with:
25+
cancel-others: true
26+
1327
build:
1428
name: Build
29+
needs:
30+
- pre
31+
if: needs.pre.outputs.should-skip != 'true'
1532
runs-on: ubuntu-latest
1633
outputs:
1734
artifact-name: ${{ steps.build.outputs.artifact-name }}
@@ -31,7 +48,7 @@ jobs:
3148
if: startsWith(github.ref, 'refs/tags/v')
3249
runs-on: ubuntu-latest
3350
concurrency:
34-
group: ${{ github.workflow }}-${{ github.ref }}-publish
51+
group: ${{ github.workflow }} @ ${{ github.ref }}
3552
cancel-in-progress: true
3653
steps:
3754
- name: Download Artifacts
@@ -51,7 +68,7 @@ jobs:
5168
if: startsWith(github.ref, 'refs/tags/v')
5269
runs-on: ubuntu-latest
5370
concurrency:
54-
group: ${{ github.workflow }}-${{ github.ref }}-release
71+
group: ${{ github.workflow }} @ ${{ github.ref }}
5572
cancel-in-progress: true
5673
steps:
5774
- name: Checkout

template/.github/workflows/test.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,31 @@ on:
99
push:
1010
branches-ignore:
1111
- assets**
12+
- dist**
1213
- gh-pages
1314
pull_request:
1415
workflow_dispatch:
1516

1617
jobs:
18+
pre:
19+
name: Pre
20+
permissions:
21+
actions: write
22+
runs-on: ubuntu-latest
23+
outputs:
24+
should-skip: ${{ steps.pre.outputs.should-skip }}
25+
steps:
26+
- id: pre
27+
name: Skip Duplicate Actions
28+
uses: liblaf/actions-ts/pre@dist
29+
with:
30+
cancel-others: true
31+
1732
detect:
1833
name: Detect
34+
needs:
35+
- pre
36+
if: needs.pre.outputs.should-skip != 'true'
1937
runs-on: ubuntu-latest
2038
outputs:
2139
test: ${{ steps.test.outcome == 'success' }}

template/.gitignore

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -175,20 +175,18 @@ poetry.toml
175175

176176
# End of https://www.toptal.com/developers/gitignore/api/python
177177

178-
*.log
179-
*.log.gz
180-
*.log.jsonl
181-
*.log.jsonl.gz
182-
playground/
183-
184178
# hatch-vcs
185179
_version.py
186180

187181
# pytest
188182
junit.xml
189183

184+
# pytest-benchmark
185+
.benchmarks/
186+
190187
# pytest-codspeed
191188
.codspeed/
192189

193-
# pytest-benchmark
194-
.benchmarks/
190+
*.log
191+
*.log.*
192+
playground/

0 commit comments

Comments
 (0)