From 592e824b368cb5af62dc1aad4760acd35f5474ba Mon Sep 17 00:00:00 2001 From: Jason Lantz Date: Thu, 31 Oct 2024 10:38:21 -0500 Subject: [PATCH] Switch workflows --- .github/workflows/python-test.yml | 57 ------------------------------- .github/workflows/test.yml | 41 ++++++++++++++++++++++ 2 files changed, 41 insertions(+), 57 deletions(-) delete mode 100644 .github/workflows/python-test.yml create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/python-test.yml b/.github/workflows/python-test.yml deleted file mode 100644 index 6938fd3..0000000 --- a/.github/workflows/python-test.yml +++ /dev/null @@ -1,57 +0,0 @@ -name: Python Tests - -on: - push: - branches: - - main - - 'releases/**' - pull_request: - - -jobs: - test: - runs-on: ubuntu-latest - - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: '3.10' - - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install poetry - poetry install - - - name: Run tests - run: | - poetry run pytest --cov=./ --cov-report=xml --cov-report=html - - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v3 - with: - token: ${{ secrets.CODECOV_TOKEN }} - files: ./coverage.xml - flags: unittests - name: codecov-umbrella - - - name: Generate test report - run: | - mkdir -p reports - pytest --junitxml=reports/junit.xml - - - name: Upload test report - uses: actions/upload-artifact@v3 - with: - name: test-report - path: reports/junit.xml - - - name: Post test summary - run: | - echo "## Test Summary" >> $GITHUB_STEP_SUMMARY - echo "" >> $GITHUB_STEP_SUMMARY - echo "Test results and coverage report have been generated." >> $GITHUB_STEP_SUMMARY diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..fb4d976 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,41 @@ +name: Run Tests +on: + push: + branches: + - "**" +jobs: + test: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.10" + + - name: Install Poetry + uses: snok/install-poetry@v1 + with: + version: 1.7.1 + virtualenvs-create: true + virtualenvs-in-project: true + + - name: Cache dependencies + uses: actions/cache@v4 + with: + path: | + .venv + ~/.cache/pypoetry + key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }} + restore-keys: | + ${{ runner.os }}-poetry- + + - name: Install dependencies + run: | + poetry install --with dev + + - name: Run tests + run: | + poetry run pytest tests/