Skip to content

Commit

Permalink
ci(workflows): add CI/CD workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
arunanshub committed Aug 23, 2024
1 parent 2babafe commit d79281a
Showing 1 changed file with 109 additions and 0 deletions.
109 changes: 109 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
name: CI

on:
push:
branches:
- master
tags:
- "v*.*.*"
pull_request:
workflow_dispatch:

permissions:
contents: read

jobs:
build:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ["3.9", "3.10", "3.11", "3.12"]

runs-on: ${{ matrix.os}}

steps:
- name: Checkout repository 👁️
uses: actions/checkout@v4

- name: Install mold linker 🔗
if: ${{ matrix.os != 'windows-latest' }}
uses: rui314/setup-mold@v1

- name: Install Rust 🦀
uses: dtolnay/rust-toolchain@stable
with:
components: clippy

- name: Setup Rust Cache 🗄️
uses: Swatinem/rust-cache@v2

- name: Install cargo nextest 🚢
uses: taiki-e/install-action@v2
with:
tool: nextest

- name: Check Rust Formatting 🖌️
run: cargo fmt --check --all

- name: Run Cargo Check 🚢
run: cargo check --workspace --all-features

- name: Run Cargo Clippy Lint 🧹
run: cargo clippy --all-targets --all-features

- name: Run Cargo Test 🧪
run: cargo nextest run --all-features --all-targets --workspace
env:
PROPTEST_CASES: 5000

- name: Install Python ${{ matrix.python-version }} 🐍
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Setup PDM 📦
uses: pdm-project/[email protected]
id: setup-pdm
with:
cache: true
python-version: ${{ matrix.python-version }}

- name: Install Python Dependencies 📦
run: pdm install --no-editable

- name: Check Python Formatting 🖌️
run: pdm run ruff check .

- name: Check Python Typing 🔤
run: pdm run mypy .

- name: Run Python Tests 🧪
run: pdm run pytest -n auto -d --cov=src --cov-report=lcov --cov-branch

- name: Upload Coverage Report 📊
uses: coverallsapp/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
file: "./coverage.lcov"
parallel: true
flag-name: run-${{ matrix.os }}-python-${{ matrix.python-version }}

- name: Build wheels 🛞
uses: pypa/[email protected]

- name: Upload wheel artifacts 🫖
uses: actions/upload-artifact@v4
with:
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
path: ./wheelhouse/*.whl

finish-coverage:
needs: [build]
runs-on: ubuntu-latest

steps:
- name: Finish Coverage Report
uses: coverallsapp/github-action@643bc377ffa44ace6394b2b5d0d3950076de9f63 # v2.3.0
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel-finished: true

0 comments on commit d79281a

Please sign in to comment.