Skip to content

Commit

Permalink
Merge pull request #1 from cospectrum/dev
Browse files Browse the repository at this point in the history
add `ci`
  • Loading branch information
cospectrum authored Dec 14, 2024
2 parents d9ef8fe + 0ce4c42 commit fa0ba60
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 2 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/actionlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Lint GitHub Actions workflows
on: [push, pull_request]

jobs:
actionlint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Download actionlint
id: get_actionlint
run: bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash)
shell: bash
- name: Check workflow files
run: ${{ steps.get_actionlint.outputs.executable }} -color
shell: bash
37 changes: 37 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: ci

on:
push:
branches: [main, master]
pull_request:

# If new code is pushed to a PR branch, then cancel in progress workflows for that PR. Ensures that
# we don't waste CI time
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
python:
runs-on: ubuntu-latest
name: python
steps:
- uses: actions/checkout@v4
with:
lfs: true
- name: Install uv
uses: astral-sh/setup-uv@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version-file: ".python-version"
- name: Install the project
run: uv sync --all-extras --dev
- name: pytest
run: uv run pytest
- name: mypy
run: uv run mypy .
- name: ruff check
run: uv run ruff check
- name: ruff format
run: uv run ruff format --check
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,7 @@ for card in cards:

img.save("./assets/result.png")
```
<img align="middle" src="./assets/result.png">

<p align="middle">
<img src="./assets/result.png">
</p>
12 changes: 11 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
import pytest
import os

from pathlib import Path
from microwink import SegModel

KiB = 2**10
MiB = (2**10) * KiB


@pytest.fixture
def seg_model() -> SegModel:
return SegModel.from_path("./models/seg_model.onnx")
path = Path("./models/seg_model.onnx")
assert path.exists()
size = os.path.getsize(path)
assert 10 * MiB < size < 15 * MiB
return SegModel.from_path(path)

0 comments on commit fa0ba60

Please sign in to comment.