Repository navigation
61 lines (56 loc) · 1.73 KB
/
Copy pathtest_datashare_python.yml
File metadata and controls
61 lines (56 loc) · 1.73 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
name: Test datashare-python
on:
push:
branches: [ 'main' ]
pull_request:
paths:
- 'datashare-python/**'
env:
PYTHON_VERSION: 3.12
ASTRAL_VERSION: 0.11.6
# TODO: leverage some caching here
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
version: ${{ env.ASTRAL_VERSION }}
python-version: ${{ env.PYTHON_VERSION }}
enable-cache: true
working-directory: datashare-python
- name: Check formatting
run: cd datashare-python && uv run --with ruff ruff check --fix .
- name: Lint test
run: cd datashare-python && uv run --with ruff ruff format
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Setup Python project
uses: actions/setup-python@v6
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Cache Docker images
uses: ScribeMD/docker-cache@0.5.0
with:
key: docker-${{ runner.os }}-${{ hashFiles('docker-compose.yml') }}
- name: Start test services
run: docker compose up -d temporal-post-init elasticsearch
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
version: ${{ env.ASTRAL_VERSION }}
python-version: ${{ env.PYTHON_VERSION }}
enable-cache: true
working-directory: datashare-python
- name: Run tests
run: |
cd datashare-python
uv sync --frozen --all-extras --dev
uv run --frozen python -m pytest -vvv --cache-clear --show-capture=all -r A
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true