diff --git a/.github/workflows/autotest.yml b/.github/workflows/autotest.yml index 5b13911..d6f0382 100644 --- a/.github/workflows/autotest.yml +++ b/.github/workflows/autotest.yml @@ -1,10 +1,12 @@ -name: Monthly Full Test - -run-name: ${{ github.actor }} is running unit tests for PittAPI +name: Run unit tests on: + push: + branches: [ "dev" ] + pull_request: + branches: [ "dev" ] schedule: - - cron: '00 12 1 * *' + - cron: '00 12 1 * *' # Monthly jobs: run-test-suite: @@ -14,9 +16,9 @@ jobs: python: ["3.9", "3.10", "3.11", "3.12"] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python }} - uses: actions/setup-python@v3 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python }} # https://github.com/actions/cache/blob/main/examples.md#python---pip @@ -29,7 +31,6 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install flake8 pip install -r requirements.txt - name: Lint with flake8 run: | diff --git a/.github/workflows/tests-on-push.yml b/.github/workflows/tests-on-push.yml deleted file mode 100644 index 45c4ae8..0000000 --- a/.github/workflows/tests-on-push.yml +++ /dev/null @@ -1,48 +0,0 @@ -name: Run Tests On Push - -on: - push: - branches: [ "dev" ] - pull_request: - branches: [ "dev" ] - -permissions: - contents: read - -jobs: - build-and-test: - runs-on: ubuntu-latest - strategy: - matrix: - python: ["3.9", "3.10", "3.11", "3.12"] - - steps: - - uses: actions/checkout@v3 - - name: Set up Python ${{ matrix.python }} - uses: actions/setup-python@v3 - with: - python-version: ${{ matrix.python }} - # https://github.com/actions/cache/blob/main/examples.md#python---pip - - uses: actions/cache@v4 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} - restore-keys: | - ${{ runner.os }}-pip- - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install flake8 pytest - pip install -r requirements.txt - - 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 - # 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: Format with black - run: black --line-length=127 --check --diff . - - name: Test with pytest - run: pytest --cov=pittapi tests/ - --ignore=tests/lab_test.py - --ignore=tests/people_test.py