-
Notifications
You must be signed in to change notification settings - Fork 72
65 lines (52 loc) · 1.71 KB
/
build-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
name: Continuous Integration - Python Package
on:
workflow_call:
inputs:
# Counterintuitive, but this is the value for full history required for rev-list --count
fetch-depth:
default: 0
required: false
type: number
jobs:
ci-test-python:
name: Perform Python CI Tests
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./_packages/python
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: ${{ inputs.fetch-depth }}
- name: Set up Python with Poetry Caching
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install and configure Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v3
with:
path: ./_packages/python/.venv
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('_packages/python/poetry.lock') }}
- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-root
- name: Update Version String
run: python ./update_version.py
- name: Install dependencies
run: poetry install --no-interaction
- name: Convert Data Files
run: poetry run python ./build.py
- name: Perform Tests
run: poetry run pytest
- name: Build package
run: poetry build