-
Notifications
You must be signed in to change notification settings - Fork 6
122 lines (98 loc) · 3.04 KB
/
Copy pathbuild.yml
File metadata and controls
122 lines (98 loc) · 3.04 KB
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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
name: Python Build and Test
on:
push:
branches: [ "main", "develop" ]
pull_request:
branches: [ "main", "develop" ]
schedule:
- cron: "0 15 * * *"
permissions:
contents: read
security-events: read
env:
PYTHON_VERSION: "3.13"
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13"]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}-${{ matrix.python-version }}
cancel-in-progress: true
env:
UV_PYTHON: ${{ matrix.python-version }}
steps:
- uses: actions/checkout@v6
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Install uv
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
- name: Install dependencies
run: |
uv sync --all-extras --dev
- name: Building
run: |
uv build
- name: Linting
run: |
uv run black --check ./src
- name: Testing
run: |
export PYTHONPATH=$PWD/src
uv run python -m unittest discover -v -s ./tests -p 'test_*.py'
- name: Documentation building
run: |
export PYTHONPATH=$PWD/src
uv run sphinx-build -b html ./docs ./public
# Only run examples on push to main branch
# examples:
# runs-on: ubuntu-latest
# if: github.event_name == 'push' && github.ref == 'refs/heads/main'
# needs: build
# steps:
# - uses: actions/checkout@v6
# - name: Set up Python ${{ env.PYTHON_VERSION }}
# uses: actions/setup-python@v6
# with:
# python-version: ${{ env.PYTHON_VERSION }}
# - name: Install uv
# uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
# - name: Install dependencies
# run: |
# uv sync --all-extras --dev
# - name: Run Examples
# env:
# GITHUB_TOKEN: "${{ secrets.GHASTOOLKIT_PAT }}"
# GHASTOOLKIT_ORG_PAT: "${{ secrets.GHASTOOLKIT_ORG_PAT }}"
# run: |
# set -e
# export PYTHONPATH=$PWD/src
# for f in examples/*.py; do
# echo "[+] Running :: $f"
# uv run python $f
# done
cli:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v6
- name: Set up Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@v6
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install uv
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
- name: Install dependencies
run: |
uv sync --all-extras --dev
- name: Run CLI
env:
GITHUB_TOKEN: "${{ github.token }}"
run: |
set -e
export PYTHONPATH=$PWD/src
uv run python -m ghastoolkit --help