From 588b8699e1f58e4d46a95ed35a0fcaa6be4e86d4 Mon Sep 17 00:00:00 2001 From: Andrew Riha Date: Tue, 19 Mar 2024 23:09:23 -0700 Subject: [PATCH 1/3] Enable workflow based on preconditions --- .github/workflows/ci.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3af5bc4..0242c60 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,7 +16,15 @@ on: branches: '**' jobs: + enable-workflow: + runs-on: ubuntu-latest + if: ${{ github.event_name == 'push' || github.event_name == 'pull_request' || (github.event_name == 'schedule' && github.repository == 'apriha/lineage') }} + steps: + - name: Enable workflow based on preconditions + run: echo "Workflow enabled." + lint: + needs: [enable-workflow] runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -31,6 +39,7 @@ jobs: black --check --diff . build-docs: + needs: [enable-workflow] runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 From d978816c24e54bc1a8012197131bf5ec48b8d475 Mon Sep 17 00:00:00 2001 From: Andrew Riha Date: Tue, 19 Mar 2024 23:10:02 -0700 Subject: [PATCH 2/3] Fix syntax --- .github/workflows/ci.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0242c60..3ac0965 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,9 +11,11 @@ on: schedule: - cron: '37 3 * * 0' push: - branches: '**' + branches: + - '**' pull_request: - branches: '**' + branches: + - '**' jobs: enable-workflow: From a623df52bc6254d93a381a257513c64e21f48d1a Mon Sep 17 00:00:00 2001 From: Andrew Riha Date: Tue, 19 Mar 2024 23:20:52 -0700 Subject: [PATCH 3/3] Fix coverage upload --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3ac0965..c6e3a84 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -114,7 +114,8 @@ jobs: working-directory: C:\a\lineage\lineage run: | pytest --cov=lineage tests - - name: Upload coverage to Codecov + - name: Upload coverage to Codecov (Ubuntu & macOS) + if: ${{ matrix.os != 'windows-latest' }} uses: codecov/codecov-action@v4.1.0 with: token: ${{ secrets.CODECOV_TOKEN }}