-
Notifications
You must be signed in to change notification settings - Fork 43
78 lines (67 loc) · 2.28 KB
/
v0.6.0_install_packages.yaml
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
name: v0.6.0.dev1 - Install and Build Specified Packages
on:
push:
jobs:
test:
env:
UNIQUE_VENV_PATH: "${{ github.workspace }}/.venv_core_${{ github.run_id }}"
runs-on: self-hosted
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install Poetry
run: |
curl -sSL https://install.python-poetry.org | python3 -
echo "PATH=$HOME/.local/bin:$PATH" >> $GITHUB_ENV
- name: Generate poetry.lock (if missing)
run: |
if [ ! -f "poetry.lock" ]; then
echo "poetry.lock not found. Generating it..."
cd pkgs
poetry lock
else
echo "poetry.lock exists."
fi
- name: Install All Path Dependencies
run: |
python -m venv $UNIQUE_VENV_PATH
source $UNIQUE_VENV_PATH/bin/activate
cd pkgs/
poetry install --no-cache -vv --all-extras --with dev
- name: Extract Path Dependencies
id: extract-paths
run: |
cd pkgs
source $UNIQUE_VENV_PATH/bin/activate
output_file=$(mktemp)
poetry run python ../scripts/extract_path_dependencies.py --pyproject pyproject.toml > $output_file
path_dependencies=$(cat $output_file)
echo "path_dependencies=$path_dependencies" >> $GITHUB_ENV
env:
UNIQUE_VENV_PATH: ${{ env.UNIQUE_VENV_PATH }}
- name: Build Specified Packages
run: |
cd pkgs
source $UNIQUE_VENV_PATH/bin/activate
for package_path in $(echo ${{ env.path_dependencies }} | tr ',' ' '); do
full_path="./$package_path"
if [ -d "$full_path" ] && [ -f "$full_path/pyproject.toml" ]; then
echo "Building $full_path"
cd "$full_path"
poetry build
cd - >/dev/null
else
echo "Skipping $full_path: not a valid package directory"
fi
done
- name: Show Pip Freeze
run: |
source $UNIQUE_VENV_PATH/bin/activate
pip freeze
- name: Clean up virtual environment
if: always()
run: |
rm -rf ${{ env.UNIQUE_VENV_PATH }}