From 2c4d288bc020c1eac8ad1deba7d94321876084b9 Mon Sep 17 00:00:00 2001 From: Zhen-Qi Liu Date: Mon, 18 Nov 2024 16:51:34 -0500 Subject: [PATCH] [ENH] update GitHub Actions workflows (#143) --- .github/workflows/docker-release.yml | 8 ++++---- .github/workflows/docs.yml | 10 +++++----- .github/workflows/tests.yml | 22 +++++++++------------- 3 files changed, 18 insertions(+), 22 deletions(-) diff --git a/.github/workflows/docker-release.yml b/.github/workflows/docker-release.yml index 8d70732..67c575b 100644 --- a/.github/workflows/docker-release.yml +++ b/.github/workflows/docker-release.yml @@ -18,13 +18,13 @@ jobs: uses: actions/checkout@v4 - name: Log in to Docker Hub - uses: docker/login-action@v1.14.1 + uses: docker/login-action@v3 with: username: ${{ secrets.DOCKER_HUB_USERNAME }} password: ${{ secrets.DOCKER_HUB_PASSWORD }} - name: Log in to the Container registry - uses: docker/login-action@v1.14.1 + uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ github.actor }} @@ -32,14 +32,14 @@ jobs: - name: Extract metadata (tags, labels) for Docker id: meta - uses: docker/metadata-action@v3.8.0 + uses: docker/metadata-action@v5 with: images: | ${{ secrets.DOCKER_HUB_USERNAME }}/netneurotools ghcr.io/netneurolab/netneurotools - name: Build and push Docker image - uses: docker/build-push-action@v2.10.0 + uses: docker/build-push-action@v6 with: context: . push: true diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 5ffcd7b..c700a36 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -18,10 +18,10 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 - - name: Set up Python 3.8 - uses: actions/setup-python@v4 + - name: Set up Python 3.12 + uses: actions/setup-python@v5 with: - python-version: 3.8 + python-version: 3.12 - name: Install dependencies run: | pip install -r docs/requirements.txt @@ -32,8 +32,8 @@ jobs: run: | cd docs && make clean html - name: Upload artifact - uses: actions/upload-pages-artifact@v2 + uses: actions/upload-pages-artifact@v3 with: path: 'docs/_build/html' - name: Deploy to GitHub Pages - uses: actions/deploy-pages@v2 \ No newline at end of file + uses: actions/deploy-pages@v4 \ No newline at end of file diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 11c62ff..ca61230 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -4,7 +4,7 @@ on: workflow_dispatch: push: branches: - - master + - main pull_request: jobs: @@ -15,10 +15,10 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 0 - - name: Set up Python 3.8 - uses: actions/setup-python@v4 + - name: Set up Python 3.12 + uses: actions/setup-python@v5 with: - python-version: 3.8 + python-version: '3.12' - name: Install dependencies run: | python -m pip install --upgrade pip @@ -32,14 +32,14 @@ jobs: strategy: matrix: os: ['ubuntu-latest'] - python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] + python-version: ['3.9', '3.10', '3.11', '3.12', '3.13'] steps: - name: Checkout code uses: actions/checkout@v4 with: fetch-depth: 0 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - name: Display Python version @@ -53,18 +53,14 @@ jobs: run: python -m pip install . - name: Print netneurotools version run: python -c "import netneurotools; print(netneurotools.__version__)" - - name: Test submodule import - run: | - cd .. - python -c "from netneurotools import metrics; from netneurotools.datasets import fetch_cammoun2012" - name: Run tests run: pytest --doctest-modules --cov=netneurotools --cov-report=xml --junitxml=junit/test-results.xml --verbose --pyargs netneurotools - name: Upload coverage - uses: codecov/codecov-action@v3 + uses: codecov/codecov-action@v5 with: - file: coverage.xml + files: coverage.xml - name: Upload pytest test results - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: pytest-results-${{ matrix.os }}-${{ matrix.python-version }} path: junit/test-results.xml