From 6cc3f5cb8eeb9576a040b7561d410fc0bfe1ab5c Mon Sep 17 00:00:00 2001 From: Vignesh Kennadi Date: Fri, 6 Sep 2024 16:19:52 +0530 Subject: [PATCH 1/4] PETOSS-529 - Create Github Workflow for Python SDK to Build, Test and Lint --- .github/workflows/build-test-lint.yml | 45 +++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 .github/workflows/build-test-lint.yml diff --git a/.github/workflows/build-test-lint.yml b/.github/workflows/build-test-lint.yml new file mode 100644 index 00000000..43146be0 --- /dev/null +++ b/.github/workflows/build-test-lint.yml @@ -0,0 +1,45 @@ +name: PHP Build, Lint + +on: + push: + +jobs: + build-test-lint: + runs-on: ubuntu-latest + + steps: + - name: Checkout xero-python repo + uses: actions/checkout@v4 + with: + repository: XeroAPI/xero-python + path: xero-python + + - name: Set up Python environment + uses: actions/setup-python@v5 + with: + python-version: '3.8' + cache: 'pip' + + - name: Install dependencies + run: | + python -m venv venv + source venv/bin/activate + pip install --upgrade pip + pip install -r requirements.txt -r requirements/dev.txt + working-directory: xero-python + + - name: Run Flake8 + run: | + flake8 xero_python + working-directory: xero-python + + - name: Build package + run: python setup.py sdist + working-directory: xero-python + + # - name: Run Test + # run: | + # source venv/bin/activate + # pip install -r requirements/test.txt + # pytest -v + # working-directory: xero-python \ No newline at end of file From e808e7d251c1fd86fbd846c7f60f49ad06212ea5 Mon Sep 17 00:00:00 2001 From: Vignesh Kennadi Date: Fri, 6 Sep 2024 16:21:02 +0530 Subject: [PATCH 2/4] adds missing dependencies --- .github/workflows/build-test-lint.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build-test-lint.yml b/.github/workflows/build-test-lint.yml index 43146be0..206ca3f7 100644 --- a/.github/workflows/build-test-lint.yml +++ b/.github/workflows/build-test-lint.yml @@ -25,6 +25,8 @@ jobs: python -m venv venv source venv/bin/activate pip install --upgrade pip + pip install black + pip install flake8 pip install -r requirements.txt -r requirements/dev.txt working-directory: xero-python From 4ef9de514e5c92d535c8c10196fd1874949449f9 Mon Sep 17 00:00:00 2001 From: Vignesh Kennadi Date: Fri, 6 Sep 2024 16:26:26 +0530 Subject: [PATCH 3/4] add sudo for flake installation --- .github/workflows/build-test-lint.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-test-lint.yml b/.github/workflows/build-test-lint.yml index 206ca3f7..acdb344f 100644 --- a/.github/workflows/build-test-lint.yml +++ b/.github/workflows/build-test-lint.yml @@ -26,13 +26,12 @@ jobs: source venv/bin/activate pip install --upgrade pip pip install black - pip install flake8 + sudo pip install flake8 pip install -r requirements.txt -r requirements/dev.txt working-directory: xero-python - name: Run Flake8 - run: | - flake8 xero_python + run: flake8 xero_python working-directory: xero-python - name: Build package From c76efbb3991778aa7c5f3b975a099c9d326391ac Mon Sep 17 00:00:00 2001 From: Vignesh Kennadi Date: Fri, 6 Sep 2024 16:39:35 +0530 Subject: [PATCH 4/4] corrected the workflow name --- .github/workflows/build-test-lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-test-lint.yml b/.github/workflows/build-test-lint.yml index acdb344f..14acf9cb 100644 --- a/.github/workflows/build-test-lint.yml +++ b/.github/workflows/build-test-lint.yml @@ -1,4 +1,4 @@ -name: PHP Build, Lint +name: Python Build, Lint on: push: