-
Notifications
You must be signed in to change notification settings - Fork 3
104 lines (90 loc) · 2.93 KB
/
python_build.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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
name: Develop Branch Action
on:
pull_request_target:
types:
- opened
- synchronize
- reopened
branches:
- main
paths:
- 'unoplat-code-confluence-commons/**'
- 'unoplat-code-confluence-ingestion/**'
jobs:
prepare-matrix:
runs-on: ubuntu-latest
strategy:
matrix:
path: ['unoplat-code-confluence-commons']
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ GITHUB.HEAD_REF }}
- name: Install python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- uses: Gr1N/setup-poetry@v8
with:
poetry-version: "1.8.3"
- name: Check poetry version
run: poetry --version
- name: Install dependencies
working-directory: ${{ matrix.path }}
run: poetry install --no-root
- name: Build poetry
working-directory: ${{ matrix.path }}
run: poetry build -f wheel
test-uv-projects:
runs-on: ubuntu-latest
strategy:
matrix:
project: ['unoplat-code-confluence-ingestion/code-confluence-flow-bridge']
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ GITHUB.HEAD_REF }}
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install uv
uses: astral-sh/setup-uv@v5
- name: Install Ruff
run: curl -LsSf https://astral.sh/ruff/install.sh | sh
- name: Setup Scanner CLI
run: |
SCANNER_DIR="$HOME/.unoplat/repositories/assets"
SCANNER_JAR="scanner_cli-2.2.8-all.jar"
SCANNER_URL="https://github.com/archguard/archguard/releases/download/v2.2.8/$SCANNER_JAR"
# Create directory if it doesn't exist
mkdir -p "$SCANNER_DIR"
# Download scanner CLI
curl -L -o "$SCANNER_DIR/$SCANNER_JAR" "$SCANNER_URL"
- name: Generate Test Prerequisites
working-directory: ${{ matrix.project }}/tests/test_data/unoplat-code-confluence-cli
run: |
SCANNER_DIR="$HOME/.unoplat/repositories/assets"
SCANNER_JAR="scanner_cli-2.2.8-all.jar"
java -jar "$SCANNER_DIR/$SCANNER_JAR" \
--with-function-code --language=python \
--output=arrow --output=json \
--path=unoplat_code_confluence_cli \
--output-dir=unoplat_code_confluence_cli/ \
--depth=20
- name: Install dependencies and run tests
working-directory: ${{ matrix.project }}
env:
GITHUB_PAT_TOKEN: ${{ github.token }}
run: |
uv sync
uv run pytest tests/ -v