-
Notifications
You must be signed in to change notification settings - Fork 1
78 lines (72 loc) · 1.79 KB
/
Copy pathci.yml
File metadata and controls
78 lines (72 loc) · 1.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
lint-and-typecheck:
name: Lint & type-check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: "3.12"
cache: pip
- name: Install dev tools
run: |
pip install --upgrade pip
pip install ".[dev]"
- name: Ruff (lint)
run: ruff check mnemon/
tests:
name: Tests / Python ${{ matrix.python }}
runs-on: ubuntu-latest
needs: lint-and-typecheck
strategy:
fail-fast: false
matrix:
python: ["3.11", "3.12"]
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python }}
cache: pip
- name: Install package + dev deps
run: |
pip install --upgrade pip
pip install ".[dev]"
- name: Run unit tests
run: pytest tests/ -v
- name: Coverage report
run: pytest tests/ --cov=mnemon --cov-report=xml:coverage.xml
env:
CI: true
build:
name: Build sdist / wheel
runs-on: ubuntu-latest
needs: tests
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: "3.12"
cache: pip
- name: Install build tooling
run: pip install build twine
- name: Build distributions
run: python -m build
- name: Upload dist artifacts
uses: actions/upload-artifact@v7
with:
name: dist-${{ github.sha }}
path: dist/
retention-days: 14