Skip to content

Add lint and test ci #24

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
custom: https://wu-clan.github.io/sponsor/
43 changes: 26 additions & 17 deletions .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,36 @@
name: Change Logs

on:
pull_request_target:
branches:
- master
types:
- closed
# For manually triggering it
workflow_dispatch:
inputs:
number:
description: PR number
required: true
release:
types: [ released ]

jobs:
latest-changes:
runs-on: ubuntu-latest
permissions:
contents: write

steps:
- uses: actions/checkout@v4
- name: Checkout code
uses: actions/checkout@v4
with:
token: ${{ secrets.GH_TOKEN }}
- uses: docker://tiangolo/latest-changes:0.3.0
fetch-depth: 0
ref: ${{ github.event.release.target_commitish }}

- name: Extract release date from git tag
run: |
echo "date=$(git log -1 --date=short --format=%ad '${{ github.event.release.tag_name }}')" >> $GITHUB_OUTPUT;

- name: Update Changelog
uses: stefanzweifel/changelog-updater-action@v1
with:
latest-version: ${{ github.event.release.tag_name }}
release-notes: ${{ github.event.release.body }}
path-to-changelog: docs/changelog.md

- name: Commit updated CHANGELOG
uses: stefanzweifel/git-auto-commit-action@v5
with:
token: ${{ secrets.GH_TOKEN }}
latest_changes_file: docs/changelog.md
latest_changes_header: '# Change Logs'
branch: ${{ github.event.release.target_commitish }}
commit_message: 📝 Update release notes
file_pattern: docs/changelog.md
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
with:
python-version: 3.x
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
- uses: actions/cache@v4
- uses: actions/cache@v4FUNDING.yml
with:
key: mkdocs-material-${{ env.cache_id }}
path: .cache
Expand Down
29 changes: 29 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: ci

on:
push:
branches:
- master
pull_request:

jobs:
lint:
runs-on: ubuntu-latest
name: lint ${{ matrix.python-version }}
strategy:
matrix:
python-version: [ '3.10', '3.11', '3.12' ]
fail-fast: false
steps:
- uses: actions/checkout@v4

- name: Setup pdm
uses: pdm-project/setup-pdm@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: pdm install -G lint

- name: Run lint
run: pdm lint
29 changes: 29 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: ci

on:
push:
branches:
- master
pull_request:

jobs:
test:
runs-on: ubuntu-latest
name: test ${{ matrix.python-version }}
strategy:
matrix:
python-version: [ '3.10', '3.11', '3.12' ]
fail-fast: false
steps:
- uses: actions/checkout@v4

- name: Setup pdm
uses: pdm-project/setup-pdm@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: pdm install -G test

- name: Run test
run: pdm run -v pytest