From 01227aa3968df27e43fdc5fac417bcb572dd6914 Mon Sep 17 00:00:00 2001 From: Max Ghenis Date: Fri, 18 Oct 2024 11:14:20 -0400 Subject: [PATCH] try test --- .github/workflows/ci.yaml | 59 ++++++++++++++++++++------------------- 1 file changed, 30 insertions(+), 29 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index a3f1227..d6c0627 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -1,38 +1,39 @@ -name: Debug PR Workflow +# This workflow will install Python dependencies, run tests and lint with a variety of Python versions +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python + +name: Python package on: - pull_request: - branches: [main] - types: [opened, synchronize, reopened] push: - branches: [main] - workflow_dispatch: + branches: ["main"] + pull_request: + branches: ["main"] jobs: - debug: + build: runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v3 + strategy: + fail-fast: false + matrix: + python-version: ["3.9", "3.10", "3.11"] - - name: Debug GitHub context - env: - GITHUB_CONTEXT: ${{ toJson(github) }} - run: echo "$GITHUB_CONTEXT" - - - name: Debug event info - if: github.event_name == 'pull_request' - env: - EVENT_CONTEXT: ${{ toJson(github.event) }} + steps: + - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v3 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies run: | - echo "Pull Request Event Info:" - echo "$EVENT_CONTEXT" - - - name: Run a simple test + python -m pip install --upgrade pip + python -m pip install flake8 pytest + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + - 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: Test with pytest run: | - echo "This workflow ran successfully" - echo "Event name: ${{ github.event_name }}" - echo "PR number: ${{ github.event.pull_request.number }}" - echo "PR title: ${{ github.event.pull_request.title }}" - echo "PR base ref: ${{ github.event.pull_request.base.ref }}" - echo "PR head ref: ${{ github.event.pull_request.head.ref }}" + pytest