Skip to content

Commit 82d96d0

Browse files
authored
chore(copier): update from template
1 parent 571fa30 commit 82d96d0

File tree

15 files changed

+260
-171
lines changed

15 files changed

+260
-171
lines changed

.config/copier/.copier-answers.python.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# This file is @generated by <https://github.com/liblaf/copier-python>.
22
# DO NOT EDIT!
33
# prettier-ignore
4-
_commit: c22d7f1
4+
_commit: a01f7fd
55
_src_path: gh:liblaf/copier-python
66
answers_file_shared: .config/copier/.copier-answers.shared.yaml
77
namespace: ''
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# This file is @generated by <https://github.com/liblaf/copier-release>.
22
# DO NOT EDIT!
33
# prettier-ignore
4-
_commit: 55dfc73
4+
_commit: v0.1.1
55
_src_path: gh:liblaf/copier-release
66
release_type: python

.config/copier/.copier-answers.shared.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# This file is @generated by <https://github.com/liblaf/copier-shared>.
22
# DO NOT EDIT!
33
# prettier-ignore
4-
_commit: 610df18
4+
_commit: v0.1.0
55
_src_path: gh:liblaf/copier-shared
66
author_email: [email protected]
77
author_name: liblaf

.config/copier/mise-tasks/bench.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,4 @@ set -o errexit
55
set -o nounset
66
set -o pipefail
77

8-
# ref: <https://github.com/scientific-python/lazy-loader#early-failure>
9-
export EAGER_IMPORT=1
10-
118
pytest -m 'benchmark' --numprocesses 0 --codspeed --codspeed-warmup-time='0.2' "$@"

.config/copier/mise-tasks/test.sh

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,12 @@ set -o errexit
55
set -o nounset
66
set -o pipefail
77

8-
function is-in-ci() {
9-
if [[ -z ${CI:-} ]]; then
8+
function in-ci() {
9+
if [[ -n ${CI:-} ]]; then
10+
return 0
11+
else
1012
return 1
1113
fi
12-
case "${CI,,}" in
13-
1 | on | true | y | yes) return 0 ;;
14-
0 | off | false | n | no | "") return 1 ;;
15-
*)
16-
echo "Invalid boolean: $CI." >&2
17-
exit 1
18-
;;
19-
esac
2014
}
2115

2216
function needs-gpu() {
@@ -37,7 +31,7 @@ else
3731
numprocesses='auto'
3832
fi
3933

40-
if is-in-ci; then
34+
if in-ci; then
4135
# ref: <https://docs.codecov.com/docs/test-analytics#1-output-a-junit-xml-file-in-your-ci>
4236
pytest \
4337
--junit-xml='junit.xml' --override-ini junit_family=legacy \

.config/release-please/config.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@
5050
"section": "⏪️ Reverts"
5151
}
5252
],
53-
"extra-label": "automerge",
5453
"include-component-in-tag": false,
5554
"always-update": true,
5655
"initial-version": "0.1.0",

.github/workflows/bench.yaml

Lines changed: 28 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -5,37 +5,36 @@ name: Bench
55

66
on:
77
push:
8+
branches-ignore:
9+
- copier-update
10+
- mega-linter-fix/**
11+
- pre-commit-ci-update-config
12+
- release-please--branches**
813
pull_request:
914
workflow_dispatch:
1015

11-
jobs:
12-
skip-duplicate:
13-
name: Skip Duplicate
14-
permissions:
15-
actions: write
16-
runs-on: ubuntu-latest
17-
outputs:
18-
should-skip: ${{ steps.skip-duplicate.outputs.should-skip }}
19-
steps:
20-
- id: skip-duplicate
21-
name: Skip Duplicate
22-
uses: liblaf/actions/skip-duplicate@dist
23-
with:
24-
cancel-others: true
16+
env:
17+
FORCE_COLOR: 1
2518

26-
collect:
27-
name: Collect
28-
needs:
29-
- skip-duplicate
30-
if: needs.skip-duplicate.outputs.should-skip != 'true'
19+
concurrency:
20+
group: ${{ github.workflow }} @ ${{ github.ref }}
21+
cancel-in-progress: true
22+
23+
jobs:
24+
metadata:
25+
name: Metadata
3126
runs-on: ubuntu-latest
3227
outputs:
3328
has-benches: ${{ steps.collect.outputs.has-benches }}
29+
python-versions: ${{ steps.inspect.outputs.supported_python_classifiers_json_array }}
3430
steps:
3531
- name: Checkout
3632
uses: actions/checkout@v5
33+
- id: inspect
34+
name: Build and Inspect a Python Package
35+
uses: hynek/build-and-inspect-python-package@v2
3736
- name: Setup Python
38-
uses: liblaf/actions/setup-python@dist
37+
uses: liblaf/actions/setup-python@v1
3938
- id: collect
4039
name: Collect
4140
run: |-
@@ -48,14 +47,16 @@ jobs:
4847
bench:
4948
name: Bench
5049
needs:
51-
- collect
52-
if: needs.collect.outputs.has-benches == 'true'
50+
- metadata
51+
if: needs.metadata.outputs.has-benches == 'true'
5352
runs-on: ubuntu-latest
5453
steps:
5554
- name: Checkout
5655
uses: actions/checkout@v5
5756
- name: Setup Python
58-
uses: liblaf/actions/setup-python@dist
57+
uses: liblaf/actions/setup-python@v1
58+
with:
59+
python-version: ${{ matrix.python-version }}
5960
- name: Install Mise
6061
uses: jdx/mise-action@v3
6162
- name: Bench
@@ -65,3 +66,7 @@ jobs:
6566
mode: instrumentation
6667
env:
6768
FORCE_COLOR: 1
69+
strategy:
70+
matrix:
71+
python-version: ${{ fromJson(needs.metadata.outputs.python-versions) }}
72+
fail-fast: false

.github/workflows/build.yaml

Lines changed: 0 additions & 36 deletions
This file was deleted.

.github/workflows/docs.yaml

Lines changed: 33 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -5,54 +5,53 @@ name: Docs
55

66
on:
77
push:
8+
branches-ignore:
9+
- copier-update
10+
- mega-linter-fix/**
11+
- pre-commit-ci-update-config
12+
- release-please--branches**
813
pull_request:
914
workflow_dispatch:
1015

1116
jobs:
12-
skip-duplicate:
13-
name: Skip Duplicate
14-
permissions:
15-
actions: write
16-
runs-on: ubuntu-latest
17-
outputs:
18-
should-skip: ${{ steps.skip-duplicate.outputs.should-skip }}
19-
steps:
20-
- id: skip-duplicate
21-
name: Skip Duplicate
22-
uses: liblaf/actions/skip-duplicate@dist
23-
with:
24-
cancel-others: true
25-
26-
docs:
27-
name: Docs
28-
permissions:
29-
contents: write
30-
pages: write
31-
needs:
32-
- skip-duplicate
33-
if: needs.skip-duplicate.outputs.should-skip != 'true'
17+
build:
18+
name: Build
3419
runs-on: ubuntu-latest
3520
steps:
3621
- name: Checkout
3722
uses: actions/checkout@v5
3823
with:
3924
fetch-depth: 0
25+
- id: config
26+
name: Configure GitHub Pages
27+
uses: actions/configure-pages@v5
28+
- name: Set Environment Variables
29+
run: printf 'SITE_URL=%s\n' '${{ steps.config.outputs.base_url }}' >> "$GITHUB_ENV"
4030
- name: Setup Python
41-
uses: liblaf/actions/setup-python@dist
31+
uses: liblaf/actions/setup-python@v1
4232
- if: hashFiles('docs/scripts/pre-build.sh') != ''
4333
name: Pre-Build
4434
run: docs/scripts/pre-build.sh
4535
- name: Build
4636
run: mkdocs build
47-
- if: ${{ github.ref == 'refs/heads/main' }}
48-
name: Deploy
49-
uses: JamesIves/github-pages-deploy-action@v4
37+
- name: Upload Github Pages Artifact
38+
uses: actions/upload-pages-artifact@v4
5039
with:
51-
folder: site
52-
single-commit: true
53-
- if: ${{ github.ref == 'refs/heads/main' }}
54-
name: Setup GitHub Pages
55-
uses: liblaf/actions/setup-pages@dist
56-
with:
57-
token: ${{ github.token }}
58-
continue-on-error: true
40+
path: site
41+
42+
deploy:
43+
name: Deploy
44+
permissions:
45+
id-token: write
46+
pages: write
47+
needs:
48+
- build
49+
if: github.ref == 'refs/heads/main'
50+
runs-on: ubuntu-latest
51+
environment:
52+
name: github-pages
53+
url: ${{ steps.deploy.outputs.page_url }}
54+
steps:
55+
- id: deploy
56+
name: Deploy Github Pages Site
57+
uses: actions/deploy-pages@v4

.github/workflows/mega-linter.yaml

Lines changed: 17 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -11,42 +11,37 @@ on:
1111
pull_request:
1212
workflow_dispatch:
1313

14-
jobs:
15-
skip-duplicate:
16-
name: Skip Duplicate
17-
permissions:
18-
actions: write
19-
runs-on: ubuntu-latest
20-
outputs:
21-
should-skip: ${{ steps.skip-duplicate.outputs.should-skip }}
22-
steps:
23-
- id: skip-duplicate
24-
name: Skip Duplicate
25-
uses: liblaf/actions/skip-duplicate@dist
26-
with:
27-
cancel-others: true
14+
env:
15+
FORCE_COLOR: 1
2816

17+
jobs:
2918
mega-linter:
3019
name: MegaLinter
3120
permissions:
3221
contents: write
33-
issues: write
3422
pull-requests: write
35-
needs:
36-
- skip-duplicate
37-
if: needs.skip-duplicate.outputs.should-skip != 'true'
23+
# skip PR from the same repo, they will be handled by `push` event
24+
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository
3825
runs-on: ubuntu-latest
26+
environment:
27+
name: MegaLinter
3928
steps:
29+
- id: auth
30+
name: Auth
31+
uses: liblaf/actions/auth@dist
32+
with:
33+
app-id: ${{ vars.APP_ID }}
34+
private-key: ${{ secrets.PRIVATE_KEY }}
4035
- name: Checkout
4136
uses: actions/checkout@v5
42-
with:
43-
ref: ${{ github.head_ref || github.ref }}
4437
- id: lint
4538
name: MegaLinter
4639
uses: liblaf/actions/mega-linter@dist
40+
with:
41+
token: ${{ steps.auth.outputs.token }}
4742
- if: success() || failure()
4843
name: Upload Reports
49-
uses: actions/upload-artifact@v4
44+
uses: actions/upload-artifact@v5
5045
with:
5146
name: mega-linter-reports
5247
path: |-
@@ -67,9 +62,7 @@ jobs:
6762
sign-commits: true
6863
title: "chore(mega-linter): apply linters automatic fixes"
6964
body-path: ${{ runner.temp }}/megalinter-report.md
70-
labels: |-
71-
autofix
72-
automerge
65+
labels: automerge,bot
7366
assignees: ${{ github.repository_owner }}
7467
reviewers: ${{ github.repository_owner }}
7568
- if: steps.lint.outputs.has-updated-sources > 0 && github.ref != 'refs/heads/main'

0 commit comments

Comments
 (0)