From 46dea3a2c9e14c8667ccf372601043fbb342f56d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexandre=20D=C3=A9fossez?= Date: Tue, 17 Sep 2024 13:42:24 +0200 Subject: [PATCH] adding ci and community stuff --- .github/ISSUE_TEMPLATE/bug.md | 29 +++++++++ .github/ISSUE_TEMPLATE/question.md | 9 +++ .github/PULL_REQUEST_TEMPLATE.md | 1 + .github/actions/moshi_build/action.yml | 27 +++++++++ .github/workflows/precommit.yml | 17 ++++++ .github/workflows/rust-ci.yml | 84 ++++++++++++++++++++++++++ requirements-dev.txt | 3 + 7 files changed, 170 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/bug.md create mode 100644 .github/ISSUE_TEMPLATE/question.md create mode 100644 .github/PULL_REQUEST_TEMPLATE.md create mode 100755 .github/actions/moshi_build/action.yml create mode 100644 .github/workflows/precommit.yml create mode 100644 .github/workflows/rust-ci.yml create mode 100644 requirements-dev.txt diff --git a/.github/ISSUE_TEMPLATE/bug.md b/.github/ISSUE_TEMPLATE/bug.md new file mode 100644 index 0000000..bafcfc0 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug.md @@ -0,0 +1,29 @@ +--- +name: 🐛 Bug Report +about: Submit a bug report to help us improve +labels: bug, triage +--- + +## 🐛 Bug Report + + + +## To Reproduce + + + +## Your Environment + + + +**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: diff --git a/.github/ISSUE_TEMPLATE/question.md b/.github/ISSUE_TEMPLATE/question.md new file mode 100644 index 0000000..a074579 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/question.md @@ -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 + + diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..8ae0569 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1 @@ +# Test diff --git a/.github/actions/moshi_build/action.yml b/.github/actions/moshi_build/action.yml new file mode 100755 index 0000000..432edf4 --- /dev/null +++ b/.github/actions/moshi_build/action.yml @@ -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 diff --git a/.github/workflows/precommit.yml b/.github/workflows/precommit.yml new file mode 100644 index 0000000..fba7d72 --- /dev/null +++ b/.github/workflows/precommit.yml @@ -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 diff --git a/.github/workflows/rust-ci.yml b/.github/workflows/rust-ci.yml new file mode 100644 index 0000000..0dec8d5 --- /dev/null +++ b/.github/workflows/rust-ci.yml @@ -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 diff --git a/requirements-dev.txt b/requirements-dev.txt new file mode 100644 index 0000000..6f5acfb --- /dev/null +++ b/requirements-dev.txt @@ -0,0 +1,3 @@ +pre-commit>=3.8 +pyright>=1.1 +flake8>=7.1