Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Sh1nku committed Aug 9, 2023
0 parents commit b9f422a
Show file tree
Hide file tree
Showing 115 changed files with 8,686 additions and 0 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/count_loc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Count lines of code for the project, and upload to the badge store

on:
push:
branches:
- 'master'

jobs:
count-loc-and-upload:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v3
- id: loc
name: Count lines of code
uses: Sh1nku/count-loc-action@v1
with:
excluded: "*.xml,*.toml,*.yml"
- uses: Sh1nku/badgestore-update-badge-action@v1
name: Update badge
id: badge
with:
right-label: ${{ steps.loc.outputs.Total_code_abbreviated }}
read-write-key: ${{ secrets.LOC_COUNT_BADGE_RW_KEY }}
115 changes: 115 additions & 0 deletions .github/workflows/python_publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
# This file is autogenerated by maturin v1.1.0
# To update, run
#
# maturin generate-ci github -m ./wrappers/python/Cargo.toml
#
name: Create python wheels

on:
push:
tags:
- '*'

permissions:
contents: read

jobs:
linux:
runs-on: ubuntu-latest
strategy:
matrix:
target: [x86_64, x86, aarch64, armv7, s390x, ppc64le]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
args: --release --out dist --find-interpreter --manifest-path ./wrappers/python/Cargo.toml
sccache: 'true'
manylinux: auto
- name: Upload wheels
uses: actions/upload-artifact@v3
with:
name: wheels
path: dist

windows:
runs-on: windows-latest
strategy:
matrix:
target: [x64, x86]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.10'
architecture: ${{ matrix.target }}
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
args: --release --out dist --find-interpreter --manifest-path ./wrappers/python/Cargo.toml
sccache: 'true'
- name: Upload wheels
uses: actions/upload-artifact@v3
with:
name: wheels
path: dist

macos:
runs-on: macos-latest
strategy:
matrix:
target: [x86_64, aarch64]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
args: --release --out dist --find-interpreter --manifest-path ./wrappers/python/Cargo.toml
sccache: 'true'
- name: Upload wheels
uses: actions/upload-artifact@v3
with:
name: wheels
path: dist

sdist:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build sdist
uses: PyO3/maturin-action@v1
with:
command: sdist
args: --out dist --manifest-path ./wrappers/python/Cargo.toml
- name: Upload sdist
uses: actions/upload-artifact@v3
with:
name: wheels
path: dist

release:
name: Release
runs-on: ubuntu-latest
if: "startsWith(github.ref, 'refs/tags/')"
needs: [linux, windows, macos, sdist]
steps:
- uses: actions/download-artifact@v3
with:
name: wheels
- name: Publish to PyPI
uses: PyO3/maturin-action@v1
env:
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
with:
command: upload
args: --skip-existing *
42 changes: 42 additions & 0 deletions .github/workflows/test_python.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Test python wrapper
on: [push]
jobs:
checks:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ "3.8", "3.11" ]
docker-version: [ "8_11", "9_3" ]

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Update Rust
run: |
rustup override set stable
rustup update stable
- name: Set up venv
working-directory: ./wrappers/python
run: |
python -m venv venv
- name: Install dependencies
run: |
source venv/bin/activate
pip3 install -r requirements-dev.txt
working-directory: ./wrappers/python
- name: Install module
run: |
source venv/bin/activate
maturin develop
working-directory: ./wrappers/python
- name: Start docker containers
run: docker-compose up -d
working-directory: ./docker/${{ matrix.docker-version }}
- name: Run tests
working-directory: ./wrappers/python
run: |
source venv/bin/activate
pytest
23 changes: 23 additions & 0 deletions .github/workflows/test_rust.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Unit tests, linting, and formatting
on: [push]
jobs:
checks:
runs-on: ubuntu-latest
strategy:
matrix:
docker-version: [ "8_11", "9_3" ]
steps:
- uses: actions/checkout@v3
- name: Update Rust
run: |
rustup override set stable
rustup update stable
- name: Start docker containers
run: docker-compose up -d
working-directory: ./docker/${{ matrix.docker-version }}
- name: Run tests
run: cargo test --all-features
- name: Lint
run: cargo clippy
- name: Check formatting
run: cargo fmt --check
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/target
/Cargo.lock
6 changes: 6 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[workspace]

members = [
"framework",
"wrappers/python",
]
Loading

0 comments on commit b9f422a

Please sign in to comment.