-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (53 loc) · 1.75 KB
/
Copy pathpython-plugin-sdk.yml
File metadata and controls
63 lines (53 loc) · 1.75 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
name: Python Plugin SDK - Build & Test
on:
push:
branches: ["main", "dev*"]
paths:
- 'back-end/crates/malbox-plugin-sdk-python/**'
- 'back-end/crates/malbox-plugin-sdk/**'
- 'back-end/crates/malbox-plugin-transport/**'
- 'flake.nix'
- 'flake.lock'
- '.github/workflows/python-plugin-sdk.yml'
pull_request:
branches: ["main", "dev*"]
paths:
- 'back-end/crates/malbox-plugin-sdk-python/**'
- 'back-end/crates/malbox-plugin-sdk/**'
- 'back-end/crates/malbox-plugin-transport/**'
- 'flake.nix'
- 'flake.lock'
- '.github/workflows/python-plugin-sdk.yml'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build-and-test:
runs-on: blacksmith-4vcpu-ubuntu-2404
defaults:
run:
working-directory: back-end
env:
SQLX_OFFLINE: "true"
steps:
- uses: actions/checkout@v6
- uses: cachix/install-nix-action@v31
with:
extra_nix_config: |
experimental-features = nix-command flakes
- uses: DeterminateSystems/magic-nix-cache-action@v14
- name: Lint Python
run: nix develop ..#backend --command ruff check crates/malbox-plugin-sdk-python/
- name: Create virtualenv
run: nix develop ..#backend --command python -m venv --system-site-packages .venv
- name: Build native extension
run: >
nix develop ..#backend --command
bash -c 'source .venv/bin/activate &&
maturin develop
--manifest-path crates/malbox-plugin-sdk-python/Cargo.toml'
- name: Run tests
run: >
nix develop ..#backend --command
bash -c 'source .venv/bin/activate &&
python -m pytest crates/malbox-plugin-sdk-python/tests/ -v'