2121
2222# Allow one concurrent
2323concurrency :
24- group : pr- ${{ github.ref }}
24+ group : ${{ format('{0}-{1}', github.event_name, github. ref) }}
2525 cancel-in-progress : true
2626
27+ permissions :
28+ contents : read
29+
2730jobs :
31+ dependency-review :
32+ if : ${{ github.event_name == 'pull_request' && !github.event.pull_request.draft }}
33+ name : Dependency Review
34+ runs-on : ubuntu-latest
35+ permissions :
36+ pull-requests : write
37+ steps :
38+ - name : Checkout Repo
39+ uses : actions/checkout@v3
40+
41+ - name : Run Dependency Review
42+ uses : actions/dependency-review-action@v3
43+ with :
44+ comment-summary-in-pr : true
45+
2846 lint :
29- if : ${{ !github.event.pull_request.draft }}
47+ if : ${{ github.event_name == 'push' || (github.event_name == 'pull_request' && !github.event.pull_request.draft) }}
3048 name : Lint
3149 runs-on : ubuntu-latest
3250 steps :
@@ -39,29 +57,41 @@ jobs:
3957 - name : Setup Python
4058 uses : actions/setup-python@v4
4159 with :
42- python-version : " 3.10 "
43- cache : " poetry"
60+ python-version-file : .python-version
61+ cache : poetry
4462
4563 - name : Install dependencies
46- run : poetry install --verbose --only=dev
64+ run : |
65+ poetry self add "poetry-dynamic-versioning[plugin]"
66+ poetry install --verbose --all-extras --only=dev
67+
68+ # - name: Run ruff
69+ # run: poetry run ruff -v check .
4770
48- - name : Check imports sort
49- run : poetry run isort --profile black --check-only .
71+ - name : Run mypy
72+ run : poetry run mypy --config-file pyproject.toml
5073
51- - name : Check formatting
52- run : poetry run black --check .
74+ - name : Run isort
75+ run : poetry run isort --settings-path pyproject.toml -- check-only .
5376
54- - name : Check formatting
77+ - name : Run black
78+ run : poetry run black --config pyproject.toml --check .
79+
80+ - name : Run flake8
5581 run : poetry run flake8 --count .
5682
57- test :
58- if : ${{ !github.event.pull_request.draft }}
59- name : Test
60- needs : lint
83+ - name : Run bandit
84+ run : poetry run bandit --configfile pyproject.toml --recursive .
85+
86+ test-self :
87+ if : ${{ github.event_name == 'push' || (github.event_name == 'pull_request' && !github.event.pull_request.draft) }}
88+ name : Test (self)
89+ needs :
90+ - lint
6191 strategy :
6292 fail-fast : false
6393 matrix :
64- python-version : ["3.8", "3.9", "3.10"]
94+ python-version : ["3.8", "3.9", "3.10", "3.11" ]
6595 os : [ubuntu-latest, macos-latest, windows-latest]
6696 runs-on : ${{ matrix.os }}
6797 steps :
@@ -75,18 +105,45 @@ jobs:
75105 uses : actions/setup-python@v4
76106 with :
77107 python-version : ${{ matrix.python-version }}
78- cache : " poetry"
108+ cache : poetry
79109
80110 - name : Install dependencies
81- run : poetry install --verbose
111+ run : |
112+ poetry self add "poetry-dynamic-versioning[plugin]"
113+ poetry install --verbose --without=dev
82114
83115 - name : Test Build
84- run : |
85- poetry version --verbose
86- poetry build --verbose
116+ run : poetry build --verbose
87117
88118 - name : Test MkDocs build
119+ run : poetry run mkdocs build --verbose
120+
121+ test-plugins :
122+ if : ${{ github.event_name == 'pull_request' && !github.event.pull_request.draft }}
123+ name : Test (plugins)
124+ needs :
125+ - test-self
126+ runs-on : ubuntu-latest
127+ steps :
128+ - name : Checkout Repo
129+ uses : actions/checkout@v3
130+
131+ - name : Install Poetry
132+ run : pipx install poetry
133+
134+ - name : Setup Python
135+ uses : actions/setup-python@v4
136+ with :
137+ python-version-file : .python-version
138+ cache : poetry
139+
140+ - name : Install dependencies
89141 run : |
90- pip uninstall -y mkdocs_file_filter_plugin
91- pip install dist/mkdocs_file_filter_plugin-0.0.1.tar.gz
92- poetry run mkdocs build --verbose
142+ poetry self add "poetry-dynamic-versioning[plugin]"
143+ poetry install --verbose --without=dev
144+
145+ - name : Test Build
146+ run : poetry build --verbose
147+
148+ - name : Test MkDocs build
149+ run : poetry run mkdocs build --verbose --config-file mkdocs.plugins.yml
0 commit comments