Skip to content

Commit 7981805

Browse files
authored
Merge pull request #5 from FlacSy/develop - v.2.2.0
2 parents af694ed + e98ab2c commit 7981805

106 files changed

Lines changed: 19181 additions & 406 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/format.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Formatter
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: [main, develop]
7+
tags: ["v*"]
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
format:
14+
name: Formatter check (ruff)
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Setup Python
20+
uses: actions/setup-python@v5
21+
with:
22+
python-version: "3.12"
23+
cache: pip
24+
25+
- name: Install ruff
26+
run: pip install ruff
27+
28+
- name: Check formatting
29+
run: ruff format --check .

.github/workflows/release.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Release
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
permissions:
8+
contents: read
9+
10+
jobs:
11+
build-pypi:
12+
name: Build and publish to PyPI
13+
runs-on: ubuntu-latest
14+
permissions:
15+
id-token: write
16+
environment:
17+
name: pypi
18+
steps:
19+
- uses: actions/checkout@v4
20+
21+
- name: Build wheels
22+
uses: PyO3/maturin-action@v1
23+
with:
24+
command: build
25+
args: --release -o dist
26+
sdist: true
27+
manylinux: auto
28+
29+
- name: Publish to PyPI
30+
uses: pypa/gh-action-pypi-publish@release/v1
31+
with:
32+
skip-existing: true

.github/workflows/tests.yml

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
name: Tests
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: [main, develop]
7+
tags: ["v*"]
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
test-rust:
14+
name: Rust tests
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Setup Rust
20+
uses: dtolnay/rust-toolchain@stable
21+
22+
- name: Run Rust tests
23+
run: cargo test -p badwords-core
24+
25+
test-python:
26+
name: Python tests (${{ matrix.python-version }})
27+
runs-on: ubuntu-latest
28+
strategy:
29+
fail-fast: false
30+
matrix:
31+
python-version: ["3.10", "3.11", "3.12", "3.13"]
32+
steps:
33+
- uses: actions/checkout@v4
34+
35+
- name: Setup Python
36+
uses: actions/setup-python@v5
37+
with:
38+
python-version: ${{ matrix.python-version }}
39+
cache: pip
40+
41+
- name: Install Rust
42+
uses: dtolnay/rust-toolchain@stable
43+
44+
- name: Create venv
45+
run: python -m venv .venv
46+
47+
- name: Install dependencies
48+
run: |
49+
source .venv/bin/activate
50+
python -m pip install --upgrade pip
51+
pip install maturin
52+
cd python && maturin develop --release
53+
54+
- name: Install dev dependencies
55+
run: source .venv/bin/activate && pip install pytest pytest-benchmark
56+
57+
- name: Run Python tests
58+
run: source .venv/bin/activate && pytest tests/ -v -m "not benchmark"
59+
60+
test-wasm:
61+
name: WASM tests
62+
runs-on: ubuntu-latest
63+
steps:
64+
- uses: actions/checkout@v4
65+
66+
- name: Setup Rust
67+
uses: dtolnay/rust-toolchain@stable
68+
with:
69+
targets: wasm32-unknown-unknown
70+
71+
- name: Install wasm-pack
72+
run: cargo install wasm-pack
73+
74+
- name: Run WASM tests
75+
run: cd rust/badwords-wasm && wasm-pack test --node

.gitignore

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,13 @@
44
__pycache__/
55
.ruff_cache
66
.mypy_cache
7-
*test*
87
dist
98
*.egg-info
109
.idea
1110
t.py
12-
test.py
11+
test.py
12+
.venv
13+
venv
14+
_native/
15+
python/badwords/*.so
16+
target/

0 commit comments

Comments
 (0)