Skip to content

Commit 9184552

Browse files
authored
Add lint and test ci (#24)
* Add lint and test ci * Update changelog ci * Update test ci name
1 parent 945b362 commit 9184552

File tree

5 files changed

+86
-18
lines changed

5 files changed

+86
-18
lines changed

.github/FUNDING.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
custom: https://wu-clan.github.io/sponsor/

.github/workflows/changelog.yml

Lines changed: 26 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,36 @@
11
name: Change Logs
22

33
on:
4-
pull_request_target:
5-
branches:
6-
- master
7-
types:
8-
- closed
9-
# For manually triggering it
10-
workflow_dispatch:
11-
inputs:
12-
number:
13-
description: PR number
14-
required: true
4+
release:
5+
types: [ released ]
156

167
jobs:
178
latest-changes:
189
runs-on: ubuntu-latest
10+
permissions:
11+
contents: write
12+
1913
steps:
20-
- uses: actions/checkout@v4
14+
- name: Checkout code
15+
uses: actions/checkout@v4
2116
with:
22-
token: ${{ secrets.GH_TOKEN }}
23-
- uses: docker://tiangolo/latest-changes:0.3.0
17+
fetch-depth: 0
18+
ref: ${{ github.event.release.target_commitish }}
19+
20+
- name: Extract release date from git tag
21+
run: |
22+
echo "date=$(git log -1 --date=short --format=%ad '${{ github.event.release.tag_name }}')" >> $GITHUB_OUTPUT;
23+
24+
- name: Update Changelog
25+
uses: stefanzweifel/changelog-updater-action@v1
26+
with:
27+
latest-version: ${{ github.event.release.tag_name }}
28+
release-notes: ${{ github.event.release.body }}
29+
path-to-changelog: docs/changelog.md
30+
31+
- name: Commit updated CHANGELOG
32+
uses: stefanzweifel/git-auto-commit-action@v5
2433
with:
25-
token: ${{ secrets.GH_TOKEN }}
26-
latest_changes_file: docs/changelog.md
27-
latest_changes_header: '# Change Logs'
34+
branch: ${{ github.event.release.target_commitish }}
35+
commit_message: 📝 Update release notes
36+
file_pattern: docs/changelog.md

.github/workflows/docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
with:
2020
python-version: 3.x
2121
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
22-
- uses: actions/cache@v4
22+
- uses: actions/cache@v4FUNDING.yml
2323
with:
2424
key: mkdocs-material-${{ env.cache_id }}
2525
path: .cache

.github/workflows/lint.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: ci
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
9+
jobs:
10+
lint:
11+
runs-on: ubuntu-latest
12+
name: lint ${{ matrix.python-version }}
13+
strategy:
14+
matrix:
15+
python-version: [ '3.10', '3.11', '3.12' ]
16+
fail-fast: false
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- name: Setup pdm
21+
uses: pdm-project/setup-pdm@v4
22+
with:
23+
python-version: ${{ matrix.python-version }}
24+
25+
- name: Install dependencies
26+
run: pdm install -G lint
27+
28+
- name: Run lint
29+
run: pdm lint

.github/workflows/test.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: ci
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
name: test ${{ matrix.python-version }}
13+
strategy:
14+
matrix:
15+
python-version: [ '3.10', '3.11', '3.12' ]
16+
fail-fast: false
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- name: Setup pdm
21+
uses: pdm-project/setup-pdm@v4
22+
with:
23+
python-version: ${{ matrix.python-version }}
24+
25+
- name: Install dependencies
26+
run: pdm install -G test
27+
28+
- name: Run test
29+
run: pdm run -v pytest

0 commit comments

Comments
 (0)