-
Notifications
You must be signed in to change notification settings - Fork 33
83 lines (80 loc) · 2.52 KB
/
python.yml
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
79
80
81
82
83
name: Python
on:
push:
branches:
- "main"
pull_request:
jobs:
lint:
name: Lint and documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install tools
run: pip install flake8 black isort wheel docstring-parser
- name: Lint
run: |
black --check substra
isort --check substra
flake8 substra
- name: Install substra
run: pip install -e .
- name: Generate and validate SDK documentation
run: |
python bin/generate_sdk_documentation.py --output-path='references/sdk.md'
python bin/generate_sdk_schemas_documentation.py --output-path references/sdk_schemas.md
python bin/generate_sdk_schemas_documentation.py --models --output-path='references/sdk_models.md'
- name: Documentation artifacts
uses: actions/upload-artifact@v4
if: always()
with:
retention-days: 1
name: references
path: references/*
tests:
runs-on: ubuntu-20.04
env:
XDG_RUNTIME_DIR: /home/runner/.docker/run
DOCKER_HOST: unix:///home/runner/.docker/run/docker.sock
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]
name: Tests on Python ${{ matrix.python-version }}
steps:
- name: Set up python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
architecture: x64
- name: Install Docker rootless
run: |
sudo systemctl disable --now docker.service
export FORCE_ROOTLESS_INSTALL=1
curl -fsSL https://get.docker.com/rootless | sh
- name: Configure docker
run: |
export PATH=/home/runner/bin:$PATH
/home/runner/bin/dockerd-rootless.sh & # Start Docker rootless in the background
- name: Cloning substra
uses: actions/checkout@v4
with:
path: substra
- name: Cloning substratools
uses: actions/checkout@v4
with:
repository: Substra/substra-tools
path: substratools
ref: main
- name: Install substra and substratools
run: |
pip install --no-cache-dir -e substratools
pip install --no-cache-dir -e 'substra[dev]'
- name: Test
run: |
export PATH=/home/runner/bin:$PATH
cd substra && make test