Skip to content
This repository was archived by the owner on Feb 1, 2023. It is now read-only.

Commit bd6e17e

Browse files
fix!: drop support for LegacyVersion (#29)
* ci: run test for dependabot/pip/** * fix!: do not support LegacyVersion * ci: fix git-cliff args Co-authored-by: JamzumSum <zzzzss990315@gmail.com>
1 parent d411aa6 commit bd6e17e

File tree

6 files changed

+379
-391
lines changed

6 files changed

+379
-391
lines changed

.github/workflows/ci.yml

Lines changed: 7 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# This workflow will install Python dependencies, run tests and lint with a single version of Python
22
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
33

4-
name: Test
4+
name: Auto CI
55

66
on:
77
push:
@@ -12,66 +12,28 @@ on:
1212
- src/**
1313
- poetry.lock
1414
- .github/workflows/ci.yml
15+
- .github/workflows/test.yml
1516

1617
jobs:
1718
test:
18-
runs-on: ubuntu-latest
19-
if: "!contains(github.event.head_commit.message, '@no-test')"
20-
strategy:
21-
matrix:
22-
python-version: ["3.10", "3.7"]
23-
outputs:
24-
package-version: ${{ steps.test.outputs.package }}
25-
steps:
26-
#----------------------------------------------
27-
# check-out repo and set-up python
28-
#----------------------------------------------
29-
- uses: actions/checkout@v3
30-
- name: Install Poetry
31-
run: pipx install poetry
32-
- name: Setup Python ${{ matrix.python-version }}
33-
uses: actions/setup-python@v4
34-
with:
35-
python-version: ${{ matrix.python-version }}
36-
cache: poetry
37-
#----------------------------------------------
38-
# install your root project, if required
39-
#----------------------------------------------
40-
- name: Install library
41-
run: |
42-
poetry install -n -vv
43-
#----------------------------------------------
44-
# add matrix specifics and run test suite
45-
#----------------------------------------------
46-
- name: Test with pytest
47-
id: test
48-
run: |
49-
poetry run pytest test
50-
echo "::set-output name=package::$(poetry version -s)"
19+
uses: ./.github/workflows/test.yml
5120

5221
merge:
5322
runs-on: ubuntu-latest
5423
if: "!contains(github.event.head_commit.message, '@no-pr')"
5524
needs: test
25+
env:
26+
TARGET: release
5627
steps:
5728
- uses: actions/checkout@v3
5829
with:
59-
ref: release
60-
61-
- name: Get release SHA
62-
id: sha
63-
run: echo "::set-output name=sha::$(git rev-parse --short HEAD)"
64-
65-
- uses: actions/checkout@v3
66-
with:
67-
ref: ${{ github.ref }}
6830
fetch-depth: 0
6931
- name: Generate a changelog
70-
uses: orhun/git-cliff-action@v1
32+
uses: orhun/git-cliff-action@v2
7133
id: git-cliff
7234
with:
7335
config: cliff.toml
74-
args: -t ${{ needs.test.outputs.package-version }} ${{ steps.sha.outputs.sha }}..HEAD
36+
args: -t ${{ needs.test.outputs.package-version }} ${{ env.TARGET }}..HEAD
7537
env:
7638
OUTPUT: CHANGELOG.md
7739

.github/workflows/test.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Test
2+
3+
on:
4+
workflow_call:
5+
pull_request:
6+
branches:
7+
- dependabot/pip/**
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
if: "!contains(github.event.head_commit.message, '@no-test')"
13+
strategy:
14+
matrix:
15+
python-version: ["3.11", "3.7"]
16+
outputs:
17+
package-version: ${{ steps.test.outputs.package }}
18+
steps:
19+
#----------------------------------------------
20+
# check-out repo and set-up python
21+
#----------------------------------------------
22+
- uses: actions/checkout@v3
23+
- name: Install Poetry
24+
run: pipx install poetry
25+
- name: Setup Python ${{ matrix.python-version }}
26+
uses: actions/setup-python@v4
27+
with:
28+
python-version: ${{ matrix.python-version }}
29+
cache: poetry
30+
#----------------------------------------------
31+
# install your root project, if required
32+
#----------------------------------------------
33+
- name: Install library
34+
run: |
35+
poetry install -n -vv
36+
#----------------------------------------------
37+
# add matrix specifics and run test suite
38+
#----------------------------------------------
39+
- name: Test with pytest
40+
id: test
41+
run: |
42+
poetry run pytest test
43+
echo "package=$(poetry version -s)" >> $GITHUB_OUTPUT

.pre-commit-config.yaml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,6 @@ repos:
1717
pass_filenames: false
1818
language: system
1919
files: pyproject.toml
20-
- id: poetry
21-
name: poetry lock
22-
entry: poetry lock -v
23-
pass_filenames: false
24-
language: system
2520
- id: isort
2621
name: isort (python)
2722
entry: poetry run isort .

0 commit comments

Comments
 (0)