From 0d7e6802de7a21ae989eeb32cb70827718ae20e0 Mon Sep 17 00:00:00 2001 From: Nils Herrmann <88451442+nils-herrmann@users.noreply.github.com> Date: Wed, 19 Jun 2024 10:58:20 +0200 Subject: [PATCH] Update action versions and implement checkout of fork for tests (#146) --- .github/workflows/test-and-build-docs.yml | 20 ++++++++++++++------ tests/__init__.py | 0 2 files changed, 14 insertions(+), 6 deletions(-) create mode 100644 tests/__init__.py diff --git a/.github/workflows/test-and-build-docs.yml b/.github/workflows/test-and-build-docs.yml index b5c0e6a..26ca4c7 100644 --- a/.github/workflows/test-and-build-docs.yml +++ b/.github/workflows/test-and-build-docs.yml @@ -10,9 +10,13 @@ jobs: test: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + ref: ${{ github.event.pull_request.head.ref }} + repository: ${{ github.event.pull_request.head.repo.full_name }} - name: Set up Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: python-version: 3.8 - name: Install dependencies @@ -25,14 +29,18 @@ jobs: - name: Run tests run: pytest --cov=pubmed_parser tests/ --verbose - name: Upload coverage to Codecov - uses: codecov/codecov-action@v1 + uses: codecov/codecov-action@v4 docs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + ref: ${{ github.event.pull_request.head.ref || github.ref }} + repository: ${{ github.event.pull_request.head.repo.full_name || github.repository }} - name: Set up Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: python-version: 3.8 - name: Install dependencies @@ -48,7 +56,7 @@ jobs: make html touch _build/html/.nojekyll - name: Deploy to GitHub Pages - uses: peaceiris/actions-gh-pages@v3 + uses: peaceiris/actions-gh-pages@v4 with: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: docs/_build/html/ diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 0000000..e69de29