Skip to content

Commit 9ded9cc

Browse files
build bernard in CI to make things go very way more faster
1 parent 3bc87f0 commit 9ded9cc

10 files changed

Lines changed: 119 additions & 8 deletions
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Build bernard-ledit Wheel
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
include_macos:
7+
required: false
8+
type: boolean
9+
default: false
10+
workflow_dispatch:
11+
inputs:
12+
include_macos:
13+
required: false
14+
type: boolean
15+
default: false
16+
17+
jobs:
18+
build-wheel:
19+
name: Build bernard-ledit wheel
20+
timeout-minutes: 30
21+
strategy:
22+
matrix:
23+
include:
24+
- os: "ubuntu-22.04"
25+
requires_macos: false
26+
- os: "windows-2022"
27+
requires_macos: false
28+
- os: "macos-latest"
29+
requires_macos: true
30+
if: ${{ !matrix.requires_macos || inputs.include_macos }}
31+
runs-on: ${{ matrix.os }}
32+
steps:
33+
- uses: actions/checkout@v6
34+
with:
35+
submodules: recursive
36+
37+
- name: Set up Python 3.10
38+
uses: actions/setup-python@v6
39+
with:
40+
python-version: "3.10"
41+
42+
- name: Build bernard-ledit wheel
43+
run: |
44+
python -m pip install --upgrade pip
45+
pip wheel --no-deps --wheel-dir ./.github/artifacts/bernard-ledit bernard-ledit/bindings/python/
46+
47+
- name: Upload bernard-ledit wheel
48+
uses: actions/upload-artifact@v4
49+
with:
50+
name: bernard-ledit-wheel-${{ runner.os }}
51+
path: ./.github/artifacts/bernard-ledit/*.whl
52+
if-no-files-found: error

.github/workflows/_smoke-test.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,17 @@ jobs:
4242
restore-keys: |
4343
${{ runner.os }}-samples-
4444
45+
- name: Download prebuilt bernard-ledit wheel
46+
uses: actions/download-artifact@v5
47+
continue-on-error: true
48+
with:
49+
name: bernard-ledit-wheel-${{ runner.os }}
50+
path: ./.github/artifacts/bernard-ledit
51+
4552
- name: Install dependencies
4653
run: |
4754
python -m pip install pip
48-
pip install bernard-ledit/bindings/python/
55+
python -c "from pathlib import Path; import subprocess, sys; wheels = sorted(Path('.github/artifacts/bernard-ledit').glob('*.whl')); subprocess.check_call([sys.executable, '-m', 'pip', 'install', str(wheels[0]) if wheels else 'bernard-ledit/bindings/python/'])"
4956
pip install -e '.'
5057
5158
- name: Tests v2 sample code

.github/workflows/_static-analysis.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,18 @@ jobs:
3131
restore-keys: |
3232
${{ runner.os }}-lint-
3333
34+
- name: Download prebuilt bernard-ledit wheel
35+
uses: actions/download-artifact@v5
36+
continue-on-error: true
37+
with:
38+
name: bernard-ledit-wheel-${{ runner.os }}
39+
path: ./.github/artifacts/bernard-ledit
40+
3441
- name: Install dependencies
3542
run: |
3643
python -m pip install pip
3744
pip install pylic~=3.6.1
38-
pip install bernard-ledit/bindings/python/
45+
python -c "from pathlib import Path; import subprocess, sys; wheels = sorted(Path('.github/artifacts/bernard-ledit').glob('*.whl')); subprocess.check_call([sys.executable, '-m', 'pip', 'install', str(wheels[0]) if wheels else 'bernard-ledit/bindings/python/'])"
3946
pip install -e '.'
4047
4148
- name: License check

.github/workflows/_test-cli.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,17 @@ jobs:
4848
restore-keys: |
4949
${{ runner.os }}-cli-
5050
51+
- name: Download prebuilt bernard-ledit wheel
52+
uses: actions/download-artifact@v5
53+
continue-on-error: true
54+
with:
55+
name: bernard-ledit-wheel-${{ runner.os }}
56+
path: ./.github/artifacts/bernard-ledit
57+
5158
- name: Install dependencies
5259
run: |
5360
python -m pip install pip
54-
pip install bernard-ledit/bindings/python/
61+
python -c "from pathlib import Path; import subprocess, sys; wheels = sorted(Path('.github/artifacts/bernard-ledit').glob('*.whl')); subprocess.check_call([sys.executable, '-m', 'pip', 'install', str(wheels[0]) if wheels else 'bernard-ledit/bindings/python/'])"
5562
pip install -e '.'
5663
5764
- name: Test V1 CLI

.github/workflows/_test-integrations.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,17 @@ jobs:
4141
restore-keys: |
4242
${{ runner.os }}-test-
4343
44+
- name: Download prebuilt bernard-ledit wheel
45+
uses: actions/download-artifact@v5
46+
continue-on-error: true
47+
with:
48+
name: bernard-ledit-wheel-${{ runner.os }}
49+
path: ./.github/artifacts/bernard-ledit
50+
4451
- name: Install dependencies
4552
run: |
4653
python -m pip install pip
47-
pip install bernard-ledit/bindings/python/
54+
python -c "from pathlib import Path; import subprocess, sys; wheels = sorted(Path('.github/artifacts/bernard-ledit').glob('*.whl')); subprocess.check_call([sys.executable, '-m', 'pip', 'install', str(wheels[0]) if wheels else 'bernard-ledit/bindings/python/'])"
4855
pip install -e '.[test]'
4956
- name: Run Integration Testing
5057
env:

.github/workflows/_test-regressions.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,17 @@ jobs:
3838
restore-keys: |
3939
${{ runner.os }}-test-
4040
41+
- name: Download prebuilt bernard-ledit wheel
42+
uses: actions/download-artifact@v5
43+
continue-on-error: true
44+
with:
45+
name: bernard-ledit-wheel-${{ runner.os }}
46+
path: ./.github/artifacts/bernard-ledit
47+
4148
- name: Install dependencies
4249
run: |
4350
python -m pip install pip
44-
pip install bernard-ledit/bindings/python/
51+
python -c "from pathlib import Path; import subprocess, sys; wheels = sorted(Path('.github/artifacts/bernard-ledit').glob('*.whl')); subprocess.check_call([sys.executable, '-m', 'pip', 'install', str(wheels[0]) if wheels else 'bernard-ledit/bindings/python/'])"
4552
pip install -e '.[test]'
4653
- name: Run Regression Testing
4754
env:

.github/workflows/_test-units.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,17 @@ jobs:
4040
restore-keys: |
4141
${{ runner.os }}-test-
4242
43+
- name: Download prebuilt bernard-ledit wheel
44+
uses: actions/download-artifact@v5
45+
continue-on-error: true
46+
with:
47+
name: bernard-ledit-wheel-${{ runner.os }}
48+
path: ./.github/artifacts/bernard-ledit
49+
4350
- name: Install dependencies
4451
run: |
4552
python -m pip install pip
46-
pip install bernard-ledit/bindings/python/
53+
python -c "from pathlib import Path; import subprocess, sys; wheels = sorted(Path('.github/artifacts/bernard-ledit').glob('*.whl')); subprocess.check_call([sys.executable, '-m', 'pip', 'install', str(wheels[0]) if wheels else 'bernard-ledit/bindings/python/'])"
4754
pip install -e '.[test]'
4855
4956
- name: Unit testing with pytest
@@ -93,4 +100,3 @@ jobs:
93100
- name: Unit testing with pytest
94101
run: |
95102
pytest
96-

.github/workflows/cron.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,19 @@ permissions:
1010
actions: read
1111

1212
jobs:
13+
build-bernard-ledit:
14+
uses: mindee/mindee-api-python/.github/workflows/_build-bernard-ledit.yml@main
15+
with:
16+
include_macos: true
1317
test-regressions:
1418
uses: mindee/mindee-api-python/.github/workflows/_test-regressions.yml@main
19+
needs: build-bernard-ledit
1520
secrets: inherit
1621
test-code-samples:
1722
uses: mindee/mindee-api-python/.github/workflows/_smoke-test.yml@main
23+
needs: build-bernard-ledit
1824
secrets: inherit
1925
test-cli:
2026
uses: mindee/mindee-api-python/.github/workflows/_test-cli.yml@main
27+
needs: build-bernard-ledit
2128
secrets: inherit

.github/workflows/pull-request.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,15 @@ permissions:
1010
jobs:
1111
workflow-lint:
1212
uses: ./.github/workflows/_workflow_lint.yml
13+
build-bernard-ledit:
14+
uses: ./.github/workflows/_build-bernard-ledit.yml
15+
with:
16+
include_macos: true
1317
static-analysis:
1418
uses: ./.github/workflows/_static-analysis.yml
15-
needs: workflow-lint
19+
needs:
20+
- workflow-lint
21+
- build-bernard-ledit
1622
test-units:
1723
uses: ./.github/workflows/_test-units.yml
1824
needs: static-analysis

.github/workflows/push-main-branch.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,13 @@ on:
66
- main
77

88
jobs:
9+
build-bernard-ledit:
10+
uses: mindee/mindee-api-python/.github/workflows/_build-bernard-ledit.yml@main
11+
with:
12+
include_macos: false
913
static-analysis:
1014
uses: mindee/mindee-api-python/.github/workflows/_static-analysis.yml@main
15+
needs: build-bernard-ledit
1116
test_units:
1217
uses: mindee/mindee-api-python/.github/workflows/_test-units.yml@main
1318
needs: static-analysis

0 commit comments

Comments
 (0)