Skip to content

Commit

Permalink
Enable github workflows for the CI
Browse files Browse the repository at this point in the history
  • Loading branch information
poljar committed Aug 16, 2024
1 parent 3942b48 commit 174f155
Show file tree
Hide file tree
Showing 2 changed files with 113 additions and 0 deletions.
65 changes: 65 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -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
48 changes: 48 additions & 0 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
@@ -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 }}

0 comments on commit 174f155

Please sign in to comment.