Skip to content

Commit 536904b

Browse files
authored
Merge pull request #151 from XeroAPI/PETOSS-529-Create-GitHub-actions-for-validating-PR-in-Python-SDK-repo
PETOSS-529 - Create Github Workflow for Python SDK to Build, Test and Lint
2 parents 200e72b + c76efbb commit 536904b

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

.github/workflows/build-test-lint.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Python Build, Lint
2+
3+
on:
4+
push:
5+
6+
jobs:
7+
build-test-lint:
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- name: Checkout xero-python repo
12+
uses: actions/checkout@v4
13+
with:
14+
repository: XeroAPI/xero-python
15+
path: xero-python
16+
17+
- name: Set up Python environment
18+
uses: actions/setup-python@v5
19+
with:
20+
python-version: '3.8'
21+
cache: 'pip'
22+
23+
- name: Install dependencies
24+
run: |
25+
python -m venv venv
26+
source venv/bin/activate
27+
pip install --upgrade pip
28+
pip install black
29+
sudo pip install flake8
30+
pip install -r requirements.txt -r requirements/dev.txt
31+
working-directory: xero-python
32+
33+
- name: Run Flake8
34+
run: flake8 xero_python
35+
working-directory: xero-python
36+
37+
- name: Build package
38+
run: python setup.py sdist
39+
working-directory: xero-python
40+
41+
# - name: Run Test
42+
# run: |
43+
# source venv/bin/activate
44+
# pip install -r requirements/test.txt
45+
# pytest -v
46+
# working-directory: xero-python

0 commit comments

Comments
 (0)