From c1aea7f4f6ed031090aacbe23295310d46ebb03b Mon Sep 17 00:00:00 2001 From: n-wbrown Date: Sat, 14 Oct 2023 18:58:41 -0700 Subject: [PATCH] set up actions for building basic package --- .github/workflows/test-build.yml | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test-build.yml b/.github/workflows/test-build.yml index 7f453c0..8a8c8c3 100644 --- a/.github/workflows/test-build.yml +++ b/.github/workflows/test-build.yml @@ -19,21 +19,27 @@ jobs: steps: - uses: actions/checkout@v3 - - name: Set up Python 3.10 + - name: Set up Python uses: actions/setup-python@v3 with: python-version: "3.10" - name: Install dependencies run: | python -m pip install --upgrade pip - pip install flake8 pytest - if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + pip install cookiecutter + - name: Build sample package + run: | + python -m cookiecutter ./ --no-input - name: Lint with flake8 run: | # stop the build if there are Python syntax errors or undefined names - flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics + flake8 ./project_name --count --select=E9,F63,F7,F82 --show-source --statistics # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide - flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - - name: Test with pytest + flake8 ./project_name --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + - name: Attempt installation + run: | + cd ./project_name + pip install -e . + - name: Show package run: | - pytest + tree ./project_name