-
Notifications
You must be signed in to change notification settings - Fork 1
152 lines (142 loc) · 5.12 KB
/
main.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
name: main
on:
push:
branches:
- "**"
pull_request:
branches:
- "**"
jobs:
lint:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install GEOS
run: sudo apt update && sudo apt install libgeos-dev
- name: Install uv
run: pip install uv
- name: Set up uv environment
run: uv venv
- name: Install dependencies with GitLab token
run: uv pip install --index-url "https://__token__:${{ secrets.GITLAB_PYPI_TOKEN }}@git.o-c.space/api/v4/projects/689/packages/pypi/simple" .[dev]
- name: Activate virtual environment & run linters
run: |
source .venv/bin/activate
isort . --check-only
black . --check
bandit:
name: bandit
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install GEOS
run: sudo apt update && sudo apt install libgeos-dev
- name: Install uv
run: pip install uv
- name: Set up uv environment
run: uv venv
- name: Install dependencies with GitLab token
run: uv pip install --index-url "https://__token__:${{ secrets.GITLAB_PYPI_TOKEN }}@git.o-c.space/api/v4/projects/689/packages/pypi/simple" .[dev]
- name: Activate virtual environment & run bandit
run: |
source .venv/bin/activate
bandit -r -c pyproject.toml . --skip B105,B106,B101
cognitive:
name: cognitive
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install GEOS
run: sudo apt update && sudo apt install libgeos-dev
- name: Install uv
run: pip install uv
- name: Set up uv environment
run: uv venv
- name: Install dependencies with GitLab token
run: uv pip install --index-url "https://__token__:${{ secrets.GITLAB_PYPI_TOKEN }}@git.o-c.space/api/v4/projects/689/packages/pypi/simple" .[dev]
- name: Activate virtual environment & run ruff
run: |
source .venv/bin/activate
ruff check . --select C901
pydocstyle:
name: pydocstyle
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install GEOS
run: sudo apt update && sudo apt install libgeos-dev
- name: Install uv
run: pip install uv
- name: Set up uv environment
run: uv venv
- name: Install dependencies with GitLab token
run: uv pip install --index-url "https://__token__:${{ secrets.GITLAB_PYPI_TOKEN }}@git.o-c.space/api/v4/projects/689/packages/pypi/simple" .[dev]
- name: Activate virtual environment & run pydocstyle
run: |
source .venv/bin/activate
pydocstyle .
test:
name: test
runs-on: ubuntu-latest
needs: [bandit, cognitive, lint, pydocstyle]
steps:
- uses: actions/checkout@v3
- name: Install GEOS
run: sudo apt update && sudo apt install libgeos-dev
- name: Install uv
run: pip install uv
- name: Set up uv environment
run: uv venv
- name: Install dependencies with GitLab token
run: uv pip install --index-url "https://__token__:${{ secrets.GITLAB_PYPI_TOKEN }}@git.o-c.space/api/v4/projects/689/packages/pypi/simple" .[dev]
- name: Activate virtual environment & run tests
run: |
source .venv/bin/activate
pytest
release:
name: tag, changelog, release, publish
runs-on: ubuntu-latest
needs: test
if: github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v3
- name: Install GEOS
run: sudo apt update && sudo apt install libgeos-dev
- name: Install uv
run: pip install uv
- name: Set up uv environment
run: uv venv
- name: Install dependencies with GitLab token
run: uv pip install --index-url "https://__token__:${{ secrets.GITLAB_PYPI_TOKEN }}@git.o-c.space/api/v4/projects/689/packages/pypi/simple" .
- name: Version
uses: paulhatch/semantic-version@v5.0.0
id: version
with:
major_pattern: "(feat!)"
minor_pattern: "(feat)"
- name: Create changelog text
id: changelog
uses: loopwerk/tag-changelog@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
exclude_types: other,doc,chore
- name: Create release
uses: actions/create-release@latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.version.outputs.version_tag }}
release_name: Release ${{ steps.version.outputs.version_tag }}
body: ${{ steps.changelog.outputs.changes }}
- name: Create changelog pull request
uses: peter-evans/create-pull-request@v2
with:
commit-message: "Release ${{ steps.version.outputs.version_tag }} [skip ci]"
labels: release, bot
title: "Release ${{ steps.version.outputs.version_tag }}"
body: |
# Release ${{ steps.version.outputs.version_tag }}
Merge this PR to update your version and changelog!
## Included Pull Requests
${{ steps.changelog.outputs.changes }}