Skip to content

Commit e09f347

Browse files
authored
ci: add pr workflow (#3)
1 parent 711b869 commit e09f347

File tree

6 files changed

+95
-6
lines changed

6 files changed

+95
-6
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: "Install stateless dependencies"
2+
inputs:
3+
python-version:
4+
description: "Python version to use"
5+
default: "3.10"
6+
required: false
7+
type: string
8+
poetry-version:
9+
description: "Poetry version to use"
10+
required: false
11+
default: "1.7.1"
12+
type: string
13+
just-version:
14+
description: "Just version to use"
15+
default: "1.16.0"
16+
required: false
17+
type: string
18+
19+
20+
runs:
21+
using: "composite"
22+
steps:
23+
- name: Set up Python ${{ inputs.python-version }}
24+
uses: actions/setup-python@v2
25+
with:
26+
python-version: ${{ inputs.python-version }}
27+
- name: Load cached Poetry installation
28+
id: cached-poetry
29+
uses: actions/cache@v3
30+
with:
31+
path: ~/.local
32+
key: poetry-0 # increment to reset cache
33+
- name: Install Poetry
34+
uses: snok/install-poetry@v1
35+
with:
36+
version: ${{ inputs.poetry-version }}
37+
virtualenvs-create: true
38+
virtualenvs-in-project: true
39+
installer-parallel: true
40+
- name: Load cached venv
41+
id: cached-poetry-dependencies
42+
uses: actions/cache@v3
43+
with:
44+
path: .venv
45+
key: venv-${{ runner.os }}-${{ inputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
46+
- name: Install dependencies
47+
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
48+
shell: bash
49+
run: poetry install --no-interaction
50+
- name: Install just
51+
uses: extractions/setup-just@v1
52+
with:
53+
just-version: ${{ inputs.just-version }}

.github/workflows/pr.yml

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: PR
2+
on:
3+
pull_request:
4+
5+
6+
jobs:
7+
test:
8+
runs-on: ubuntu-latest
9+
strategy:
10+
matrix:
11+
python-version: ["3.9", "3.10", "3.11", "3.12"]
12+
steps:
13+
- name: Check out repository
14+
uses: actions/checkout@v3
15+
- name: Install dependencies
16+
uses: ./.github/actions/install-dependencies
17+
with:
18+
python-version: ${{ matrix.python-version }}
19+
- name: Run tests
20+
run: poetry run just test
21+
lint:
22+
runs-on: ubuntu-latest
23+
steps:
24+
- name: Check out repository
25+
uses: actions/checkout@v3
26+
- name: Install dependencies
27+
uses: ./.github/actions/install-dependencies
28+
- name: Cache pre-commit
29+
uses: actions/cache@v3
30+
with:
31+
path: ~/.cache/pre-commit/
32+
key: pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}
33+
- name: lint
34+
run: poetry run just lint

justfile

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
test:
22
coverage run --source=src -m pytest tests
33
coverage report --fail-under=100
4+
5+
lint:
6+
pre-commit run --all-files

poetry.lock

+2-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ authors = ["suned <[email protected]>"]
66
readme = "README.md"
77

88
[tool.poetry.dependencies]
9-
python = "^3.9"
9+
python = "^3.10"
1010
typing-extensions = "^4.8.0"
1111
cloudpickle = "^3.0.0"
1212

src/stateless/effect.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
from dataclasses import dataclass, field
55
from functools import lru_cache, partial, wraps
66
from types import TracebackType
7-
from typing import Any, Callable, ParamSpec, Type, TypeAlias, TypeVar, cast, overload
7+
from typing import Any, Callable, Type, TypeVar, cast, overload
88

9-
from typing_extensions import Never
9+
from typing_extensions import Never, ParamSpec, TypeAlias
1010

1111
R = TypeVar("R")
1212
A = TypeVar("A")

0 commit comments

Comments
 (0)