-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (55 loc) · 1.79 KB
/
Copy pathtest.yml
File metadata and controls
60 lines (55 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
name: test
on:
push:
branches: [main]
pull_request:
concurrency:
group: test-${{ github.ref }}
cancel-in-progress: true
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v5
with:
enable-cache: true
- uses: actions/cache@v4
with:
path: ~/.cache/pre-commit
key: pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}
- run: uv run pre-commit run --all-files
test:
needs: lint
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
python-version: ["3.10", "3.11", "3.12", "3.13"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v5
with:
enable-cache: true
python-version: ${{ matrix.python-version }}
- run: uv run pytest --cov=instantlyai --cov-report=xml
- uses: codecov/codecov-action@v4
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.13'
with:
files: coverage.xml
fail_ci_if_error: false
typed-install:
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v5
- run: uv build
- run: uv venv /tmp/typed-install-check
- run: uv pip install --python /tmp/typed-install-check dist/*.whl mypy
- run: /tmp/typed-install-check/bin/python -c "import instantlyai; print(instantlyai.__version__)"
- name: fresh install type-checks downstream
run: |
echo "import instantlyai; c: instantlyai.Instantly = instantlyai.Instantly(api_key='x')" > /tmp/check.py
/tmp/typed-install-check/bin/python -m mypy --python-executable /tmp/typed-install-check/bin/python /tmp/check.py