From f5a1bb190203820226a28fb5c1dce6bc6fe6e51b Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Tue, 26 Mar 2024 10:14:38 +0800 Subject: [PATCH] Improve workflows --- .github/workflows/check.yml | 6 +++--- .github/workflows/docs.yml | 15 ++++++++++++--- .github/workflows/tests.yml | 5 ++++- 3 files changed, 19 insertions(+), 7 deletions(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index e5550d51..228d9468 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -1,3 +1,6 @@ +# +# Code lint and style checks +# name: Check on: @@ -12,9 +15,6 @@ jobs: runs-on: ubuntu-latest steps: - - name: Cancel Previous Runs - uses: styfle/cancel-workflow-action@0.12.1 - - name: Checkout uses: actions/checkout@v4 diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index ffe70a9c..11750012 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -1,10 +1,22 @@ +# +# Build and deploy documentation +# name: Docs on: push: branches: [main] + paths: + - 'HinetPy/*.py' + - 'docs/**' pull_request: branches: [main] + - 'HinetPy/*.py' + - 'docs/**' + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} jobs: deploy-docs: @@ -12,9 +24,6 @@ jobs: runs-on: ubuntu-latest steps: - - name: Cancel Previous Runs - uses: styfle/cancel-workflow-action@0.12.1 - - name: Checkout uses: actions/checkout@v4 with: diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d686a03d..97a9ed1a 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -3,12 +3,15 @@ name: Tests on: push: branches: [main] + - 'HinetPy/**' + - 'tests/**' + - '.github/workflows/tests.yml' pull_request: branches: [main] paths: - 'HinetPy/**' - 'tests/**' - - '.github/workflows/**' + - '.github/workflows/tests.yml' jobs: test: