adding ci and community stuff

This commit is contained in:
Alexandre Défossez 2024-09-17 13:42:24 +02:00
parent ccbe247d9d
commit 46dea3a2c9
7 changed files with 170 additions and 0 deletions

29
.github/ISSUE_TEMPLATE/bug.md vendored Normal file
View file

@ -0,0 +1,29 @@
---
name: 🐛 Bug Report
about: Submit a bug report to help us improve
labels: bug, triage
---
## 🐛 Bug Report
<!-- A clear and concise description of what the bug is -->
## To Reproduce
<!-- How to reproduce the bug -->
## Your Environment
<!-- Include as many relevant details about the environment you experienced the bug in.-->
**Please fill this part, failure to do so will lead to your issue being directly closed.**
- Backend impacted (Torch, MLX, or Rust):
- Operating system (OSX, Windows, Linux):
- Operating system version:
If the backend impacted is Torch:
- Python version:
- PyTorch version:
- CUDA version (run `python -c 'import torch; print(torch.version.cuda)'`):
- GPU model and memory:

9
.github/ISSUE_TEMPLATE/question.md vendored Normal file
View file

@ -0,0 +1,9 @@
---
name: "❓Questions/Help/Support"
about: If you have a question about the paper, code or algorithm, please ask here!
labels: question, triage
---
## ❓ Questions
<!-- (Please ask your question here.) -->

1
.github/PULL_REQUEST_TEMPLATE.md vendored Normal file
View file

@ -0,0 +1 @@
# Test

27
.github/actions/moshi_build/action.yml vendored Executable file
View file

@ -0,0 +1,27 @@
name: moshi_build
description: 'Build env.'
runs:
using: "composite"
steps:
- uses: actions/setup-python@v2
with:
python-version: '3.10'
- uses: actions/cache@v3
id: cache
with:
path: env
key: env-${{ hashFiles('moshi/pyproject.toml') }}
- name: Install dependencies
if: steps.cache.outputs.cache-hit != 'true'
shell: bash
run: |
python3 -m venv env
. env/bin/activate
python -m pip install --upgrade pip
pip install torch==2.4.0 --index-url https://download.pytorch.org/whl/cpu
pip install -e './moshi[dev]'
- name: Setup env
shell: bash
run: |
. env/bin/activate
pre-commit install

17
.github/workflows/precommit.yml vendored Normal file
View file

@ -0,0 +1,17 @@
name: precommmit
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
run_precommit:
name: Run precommit
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/moshi_build
- run: |
. env/bin/activate
bash .git/hooks/pre-commit

84
.github/workflows/rust-ci.yml vendored Normal file
View file

@ -0,0 +1,84 @@
on: [push, pull_request]
name: Continuous integration
jobs:
check:
name: Check
defaults:
run:
working-directory: ./rust
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
rust: [stable, nightly]
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
override: true
- uses: actions-rs/cargo@v1
with:
command: check
test:
name: Test Suite
defaults:
run:
working-directory: ./rust
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
rust: [stable, nightly]
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
override: true
- uses: actions-rs/cargo@v1
with:
command: test
fmt:
name: Rustfmt
defaults:
run:
working-directory: ./rust
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- run: rustup component add rustfmt
- uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
clippy:
name: Clippy
defaults:
run:
working-directory: ./rust
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- run: rustup component add clippy
- uses: actions-rs/cargo@v1
with:
command: clippy
args: -- -D warnings

3
requirements-dev.txt Normal file
View file

@ -0,0 +1,3 @@
pre-commit>=3.8
pyright>=1.1
flake8>=7.1