Skip to content

Commit 7d2e3f1

Browse files
authored
chore(ci): upd-ci (#31)
upd-ci
1 parent 1a19b51 commit 7d2e3f1

5 files changed

Lines changed: 114 additions & 2 deletions

File tree

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Dependabot Automation
2+
3+
on:
4+
pull_request:
5+
types: [opened, reopened, synchronize]
6+
7+
permissions:
8+
pull-requests: write
9+
contents: write
10+
11+
jobs:
12+
dependabot:
13+
runs-on: ubuntu-latest
14+
if: github.event.pull_request.user.login == 'dependabot[bot]' && github.repository == 'zoola969/cachium'
15+
steps:
16+
- name: Dependabot metadata
17+
id: metadata
18+
uses: dependabot/fetch-metadata@25dd0e34f4fe68f24cc83900b1fe3fe149efef98
19+
with:
20+
github-token: "${{ secrets.GITHUB_TOKEN }}"
21+
22+
- name: Approve a PR
23+
if: >-
24+
steps.metadata.outputs.update-type == 'version-update:semver-patch' ||
25+
steps.metadata.outputs.update-type == 'version-update:semver-minor' ||
26+
steps.metadata.outputs.update-type == 'security-update:semver-patch' ||
27+
steps.metadata.outputs.update-type == 'security-update:semver-minor'
28+
run: gh pr review --approve "$PR_URL"
29+
env:
30+
PR_URL: ${{ github.event.pull_request.html_url }}
31+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32+
33+
- name: Enable auto-merge for Dependabot PRs
34+
if: >-
35+
steps.metadata.outputs.update-type == 'version-update:semver-patch' ||
36+
steps.metadata.outputs.update-type == 'version-update:semver-minor' ||
37+
steps.metadata.outputs.update-type == 'security-update:semver-patch' ||
38+
steps.metadata.outputs.update-type == 'security-update:semver-minor'
39+
run: gh pr merge --auto --squash "$PR_URL"
40+
env:
41+
PR_URL: ${{ github.event.pull_request.html_url }}
42+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
43+
44+
pre-commit-ci:
45+
runs-on: ubuntu-latest
46+
if: github.event.pull_request.user.login == 'pre-commit-ci[bot]' && github.repository == 'zoola969/cachium'
47+
steps:
48+
- name: Approve pre-commit.ci autoupdate PR
49+
run: gh pr review --approve "$PR_URL"
50+
env:
51+
PR_URL: ${{ github.event.pull_request.html_url }}
52+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
53+
54+
- name: Enable auto-merge for pre-commit.ci PRs
55+
run: gh pr merge --auto --squash "$PR_URL"
56+
env:
57+
PR_URL: ${{ github.event.pull_request.html_url }}
58+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/docs-check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99
- 'mkdocs.yml'
1010
- '.github/workflows/docs-check.yml'
1111
push:
12-
branches: [ main ]
12+
branches: [ master ]
1313
paths:
1414
- 'docs/**'
1515
- 'mkdocs.yml'

.github/workflows/pr-title.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: PR Title
2+
3+
on:
4+
pull_request:
5+
types: [opened, edited, reopened, synchronize]
6+
7+
permissions:
8+
pull-requests: read
9+
10+
jobs:
11+
validate:
12+
name: Validate PR title
13+
runs-on: ubuntu-latest
14+
if: ${{ github.actor != 'dependabot[bot]' && github.actor != 'pre-commit-ci[bot]' }}
15+
steps:
16+
- name: Lint PR title
17+
uses: amannn/action-semantic-pull-request@48f256284bd46cdaab1048c3721360e808335d50 # v6.1.1
18+
env:
19+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
20+
with:
21+
types: |
22+
build
23+
chore
24+
ci
25+
docs
26+
feat
27+
fix
28+
perf
29+
refactor
30+
revert
31+
style
32+
test

.github/workflows/publish.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ jobs:
2020
- name: Build
2121
run: uv build
2222

23+
- name: Check package metadata
24+
run: uv run --with twine twine check dist/*
25+
2326
- name: Store package distributions
2427
uses: actions/upload-artifact@v7
2528
with:

.github/workflows/tests.yml

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,26 @@ on:
99
permissions:
1010
contents: read
1111

12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.ref }}
14+
cancel-in-progress: true
15+
1216
jobs:
1317
tests:
1418
name: "Python ${{ matrix.python-version }}"
1519
runs-on: "ubuntu-latest"
1620

1721
strategy:
1822
matrix:
19-
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
23+
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14", "3.15"]
2024

2125
steps:
2226
- uses: actions/checkout@v6
2327
- name: Install uv and set the python version
2428
uses: astral-sh/setup-uv@v7
2529
with:
2630
python-version: ${{ matrix.python-version }}
31+
enable-cache: true
2732

2833
- name: "Install dependencies"
2934
run: uv sync --locked --no-default-groups --no-install-project --group dev --group test
@@ -36,3 +41,17 @@ jobs:
3641

3742
- name: "Enforce coverage"
3843
run: uv run coverage report --show-missing --skip-covered --fail-under=100
44+
45+
check-tests:
46+
name: "Tests successful"
47+
needs: [tests]
48+
runs-on: "ubuntu-latest"
49+
if: always()
50+
51+
steps:
52+
- name: "Check results"
53+
run: |
54+
if [ "${{ needs.tests.result }}" != "success" ]; then
55+
echo "Tests failed"
56+
exit 1
57+
fi

0 commit comments

Comments
 (0)