Skip to content

Commit

Permalink
Merge pull request #2 from wolfv/main
Browse files Browse the repository at this point in the history
adding a little sprinkle of CI
  • Loading branch information
baszalmstra authored Aug 24, 2023
2 parents b1c9f12 + 26c24eb commit 529d318
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 124 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/python-bindings.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Python bindings CI

on:
push:
branches: [ $default-branch ]
paths:
- 'py-rattler/**/*'
- '.github/workflows/python-bindings.yml'
pull_request:
workflow_dispatch:

permissions:
contents: read

jobs:
format_lint_test:
name: Format, Lint and Test the Python bindings
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- run: |
curl -fsSL https://pixi.sh/install.sh | bash
echo "/home/runner/.pixi/bin" >> $GITHUB_PATH
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
components: clippy, rustfmt
- name: Format and Lint
run: |
cd py-rattler
pixi run lint
pixi run fmt-check
- name: Run tests
run: |
cd py-rattler
pixi run test
120 changes: 0 additions & 120 deletions py-rattler/.github/workflows/CI.yml

This file was deleted.

6 changes: 3 additions & 3 deletions py-rattler/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion py-rattler/pixi.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,19 @@ platforms = ["win-64", "linux-64", "osx-64", "osx-arm64"]

[tasks]
build = "maturin develop"
test = "pytest"
test = { cmd = "pytest --doctest-modules", depends_on = ["build"] }
fmt-python = "black ."
fmt-rust = "cargo fmt --all"
lint-python = "ruff ."
lint-rust = "cargo clippy --all"
fmt = { depends_on = ["fmt-python", "fmt-rust"] }
lint = { depends_on = ["lint-python", "lint-rust"] }

# checks for the CI
fmt-rust-check = "cargo fmt --all --check"
fmt-python-check = "black . --check"
fmt-check = { depends_on = ["fmt-python-check", "fmt-rust-check"] }

[dependencies]
maturin = "~=1.2.2"
pip = "~=23.2.1"
Expand Down

0 comments on commit 529d318

Please sign in to comment.