Skip to content

Commit 0ea896b

Browse files
authored
Merge pull request #14 from runemalm/feature/next-version
chore: release version 1.0.0-rc.2
2 parents 7db67f0 + 89bb900 commit 0ea896b

24 files changed

+946
-1346
lines changed

.github/actions/unittests/action.yml

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

.github/workflows/feature.yml

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ on:
55
branches:
66
- 'feature/*'
77

8+
permissions:
9+
contents: read
10+
checks: write
11+
812
jobs:
913
pre-commit:
1014
name: Run pre-commit
@@ -16,25 +20,12 @@ jobs:
1620
- name: Setup Python
1721
uses: actions/setup-python@v4
1822
with:
19-
python-version: '3.7'
23+
python-version: '3.9'
2024

2125
- name: Run pre-commit
2226
uses: pre-commit/action@v3.0.1
2327

2428
unittests:
25-
name: Run tests
26-
runs-on: ubuntu-22.04
27-
28-
strategy:
29-
matrix:
30-
python-version: [3.7.16, 3.8.18, 3.9.18, "3.10.13", 3.11.5, 3.12.0, 3.13.4]
31-
fail-fast: false
32-
33-
steps:
34-
- name: Checkout code
35-
uses: actions/checkout@v4
36-
37-
- name: Run unittests
38-
uses: ./.github/actions/unittests
39-
with:
40-
python-version: ${{ matrix.python-version }}
29+
uses: ./.github/workflows/run-unittests.yml
30+
with:
31+
python-versions: '["3.9", "3.10", "3.11", "3.12", "3.13"]'

.github/workflows/master.yml

Lines changed: 9 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -6,102 +6,28 @@ on:
66
- 'master'
77
workflow_dispatch:
88

9+
permissions:
10+
contents: write
11+
id-token: write
12+
checks: write
13+
914
jobs:
1015
pre-commit:
1116
name: Run pre-commit
1217
runs-on: ubuntu-22.04
13-
1418
steps:
1519
- name: Checkout code
1620
uses: actions/checkout@v4
1721

1822
- name: Setup Python
1923
uses: actions/setup-python@v4
2024
with:
21-
python-version: '3.7'
25+
python-version: '3.9'
2226

2327
- name: Run pre-commit
2428
uses: pre-commit/action@v3.0.1
2529

2630
unittests:
27-
name: Run unittests
28-
runs-on: ubuntu-22.04
29-
30-
strategy:
31-
matrix:
32-
python-version: [3.7.16, 3.8.18, 3.9.18, "3.10.13", 3.11.5, 3.12.0, 3.13.4]
33-
fail-fast: false
34-
35-
steps:
36-
- name: Checkout code
37-
uses: actions/checkout@v4
38-
39-
- name: Run unittests
40-
uses: ./.github/actions/unittests
41-
with:
42-
python-version: ${{ matrix.python-version }}
43-
44-
prerelease:
45-
name: Pre-release (test-pypi)
46-
needs: unittests
47-
if: success()
48-
runs-on: ubuntu-22.04
49-
50-
steps:
51-
- name: Checkout code
52-
uses: actions/checkout@v4
53-
54-
- name: Build package
55-
run: python setup.py sdist bdist_wheel
56-
57-
- name: Upload artifact
58-
uses: actions/upload-artifact@v4
59-
with:
60-
name: py-dependency-injection
61-
path: dist/
62-
63-
- name: Publish to Test PyPI
64-
uses: pypa/gh-action-pypi-publish@release/v1
65-
with:
66-
user: __token__
67-
password: ${{ secrets.TEST_PYPI_TOKEN }}
68-
repository_url: https://test.pypi.org/legacy/
69-
skip_existing: true
70-
71-
release:
72-
name: Release (pypi)
73-
needs: prerelease
74-
if: success() && (github.event_name == 'workflow_dispatch')
75-
runs-on: ubuntu-22.04
76-
77-
steps:
78-
- name: Download artifact
79-
uses: actions/download-artifact@v4
80-
with:
81-
name: py-dependency-injection
82-
path: dist/
83-
84-
- name: Extract version from setup.py
85-
id: extract-version
86-
run: |
87-
version=$(grep -Eo "version=['\"]([^'\"]+)['\"]" setup.py | awk -F"'" '{print $2}')
88-
echo "Using version: $version"
89-
echo "::set-output name=RELEASE_VERSION::$version"
90-
91-
- name: Publish to PyPI
92-
uses: pypa/gh-action-pypi-publish@release/v1
93-
with:
94-
user: __token__
95-
password: ${{ secrets.PYPI_TOKEN }}
96-
repository_url: https://upload.pypi.org/legacy/
97-
skip_existing: false
98-
99-
- name: Set up Git
100-
run: |
101-
git config --global user.name "${{ github.actor }}"
102-
git config --global user.email "${{ github.actor }}@users.noreply.github.com"
103-
104-
- name: Create and push tag
105-
run: |
106-
git tag -a v${{ steps.extract-version.outputs.RELEASE_VERSION }} -m "Release version v${{ steps.extract-version.outputs.RELEASE_VERSION }}"
107-
git push origin v${{ steps.extract-version.outputs.RELEASE_VERSION }}
31+
uses: ./.github/workflows/run-unittests.yml
32+
with:
33+
python-versions: '["3.9", "3.10", "3.11", "3.12", "3.13"]'

.github/workflows/run-unittests.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Run Unittests
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
python-versions:
7+
required: true
8+
type: string
9+
10+
permissions:
11+
contents: read
12+
checks: write
13+
14+
jobs:
15+
unittests:
16+
runs-on: ubuntu-22.04
17+
strategy:
18+
matrix:
19+
python-version: ${{ fromJson(inputs.python-versions) }}
20+
fail-fast: false
21+
22+
steps:
23+
- name: Checkout code
24+
uses: actions/checkout@v4
25+
26+
- name: Set up Python ${{ matrix.python-version }}
27+
uses: actions/setup-python@v5
28+
with:
29+
python-version: ${{ matrix.python-version }}
30+
31+
- name: Install Poetry
32+
uses: abatilo/actions-poetry@v2
33+
with:
34+
poetry-version: "2.1.4"
35+
36+
- name: Install dependencies
37+
run: poetry install --with dev
38+
39+
- name: Run unittests
40+
run: |
41+
mkdir -p reports
42+
PYTHONPATH=./src:./tests poetry run pytest ./tests/unit_test --junitxml=reports/report.xml
43+
44+
- name: Upload JUnit report
45+
uses: actions/upload-artifact@v4
46+
with:
47+
name: junit-report-${{ matrix.python-version }}
48+
path: reports/report.xml
49+
50+
- name: Publish test report
51+
uses: dorny/test-reporter@v1
52+
with:
53+
name: Unit Tests Report (${{ matrix.python-version }})
54+
path: reports/report.xml
55+
reporter: java-junit

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ repos:
1111
hooks:
1212
- id: black
1313
args: ["--line-length=88"] # Adjust line length as needed
14-
language_version: python3.7
14+
language_version: python3.9
1515
- repo: https://github.com/pycqa/flake8
1616
rev: 4.0.1 # Use the latest version
1717
hooks:

.python-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.7
1+
3.9

0 commit comments

Comments
 (0)