diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..51f003d --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,65 @@ +name: CI + +on: + workflow_dispatch: + push: + branches: [main] + pull_request: + branches: [main] + types: + - opened + - reopened + - synchronize + - ready_for_review + +env: + CARGO_TERM_COLOR: always + +jobs: + style: + name: Check style + runs-on: ubuntu-latest + + steps: + - name: Checkout the repo + uses: actions/checkout@v2 + + - name: Install Rust + uses: dtolnay/rust-toolchain@master + with: + toolchain: nightly + components: rustfmt + + - name: Cargo fmt + run: cargo fmt --all -- --check + + typos: + name: Spell Check with Typos + runs-on: ubuntu-latest + + steps: + - name: Checkout Actions Repository + uses: actions/checkout@v4 + + - name: Check the spelling of the files in our repo + uses: crate-ci/typos@master + + clippy: + name: Run clippy + needs: [style] + runs-on: ubuntu-latest + + steps: + - name: Checkout Actions Repository + uses: actions/checkout@v4 + + - name: Install rust + uses: dtolnay/rust-toolchain@master + with: + toolchain: nightly + components: clippy + + - uses: Swatinem/rust-cache@v2 + + - name: Clippy + run: cargo clippy --all-targets -- -D warnings diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml new file mode 100644 index 0000000..16a8db2 --- /dev/null +++ b/.github/workflows/python.yml @@ -0,0 +1,48 @@ +name: Python tests + +on: + workflow_dispatch: + push: + branches: [main] + pull_request: + branches: [main] + types: + - opened + - reopened + - synchronize + - ready_for_review + +jobs: + Test: + strategy: + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + python-version: [3.12] + include: + - os: ubuntu-latest + python-version: "3.11" + - os: ubuntu-latest + python-version: "3.10" + - os: ubuntu-latest + python-version: 3.9 + + runs-on: "${{ matrix.os }}" + + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + + - uses: dtolnay/rust-toolchain@master + with: + toolchain: stable + + - uses: Swatinem/rust-cache@v2 + + - run: python3 -m pip install nox + + - name: Run nox for ${{ matrix.python-version }} + working-directory: ./python + run: nox -s test-${{ matrix.python-version }}