Skip to content

Commit 53a9a33

Browse files
authored
Merge pull request #2 from dbluhm/ci/setup
ci: setup github actions
2 parents cce9260 + 9d6a763 commit 53a9a33

File tree

4 files changed

+69
-0
lines changed

4 files changed

+69
-0
lines changed
+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Code Quality Check
2+
3+
"on":
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
11+
jobs:
12+
format:
13+
name: Format and Lint Check
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v3
17+
- uses: psf/black@stable
18+
- uses: chartboost/ruff-action@v1

.github/workflows/publish.yml

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Publish
2+
on:
3+
release:
4+
types: [created]
5+
6+
jobs:
7+
deploy:
8+
runs-on: ubuntu-latest
9+
permissions:
10+
id-token: write
11+
12+
steps:
13+
- uses: actions/checkout@v3
14+
- name: Setup Python
15+
uses: pdm-project/setup-pdm@v3
16+
with:
17+
python-version: 3.9
18+
cache: true
19+
- name: Install dependencies
20+
run: pdm install
21+
- name: Run pytest
22+
run: pdm run pytest
23+
- name: Publish
24+
run: pdm publish

.github/workflows/tests.yml

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Tests
2+
on:
3+
push:
4+
branches: [ main ]
5+
pull_request:
6+
branches: [ main ]
7+
8+
jobs:
9+
test:
10+
name: Tests
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
python-version: ["3.9", "3.10", "3.11"]
15+
steps:
16+
- uses: actions/checkout@v3
17+
- uses: pdm-project/setup-pdm@v3
18+
with:
19+
python-version: ${{ matrix.python-version }}
20+
cache: true
21+
- name: Install dependencies
22+
run: pdm install
23+
- name: Run pytest
24+
run: pdm run pytest

didcomm_messaging/multiformats/multibase.py

+3
Original file line numberDiff line numberDiff line change
@@ -41,17 +41,20 @@ def decode(self, value: str) -> bytes:
4141

4242
class Base64UrlEncoder(MultibaseEncoder):
4343
"""Base64URL encoding."""
44+
4445
name = "base64url"
4546
character = "u"
4647

4748
def encode(self, value: bytes) -> str:
4849
"""Encode a byte string using the base64url encoding."""
4950
import base64
51+
5052
return base64.urlsafe_b64encode(value).decode().rstrip("=")
5153

5254
def decode(self, value: str) -> bytes:
5355
"""Decode a base64url encoded string."""
5456
import base64
57+
5558
return base64.urlsafe_b64decode(value + "=" * (-len(value) % 4))
5659

5760

0 commit comments

Comments
 (0)