From 40be9e5b2271cc8f2c7a24e0e08bd5fe51d8b08a Mon Sep 17 00:00:00 2001 From: Christiano Gontijo Date: Tue, 12 Nov 2024 15:33:42 +1300 Subject: [PATCH] GitHub actions (#56) --- .github/workflows/backend-workflow.yml | 3 ++- .github/workflows/compare-changes.yml | 10 ++++++---- .github/workflows/frontend-workflow.yml | 3 ++- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/.github/workflows/backend-workflow.yml b/.github/workflows/backend-workflow.yml index 5630b72..6685e02 100644 --- a/.github/workflows/backend-workflow.yml +++ b/.github/workflows/backend-workflow.yml @@ -14,7 +14,8 @@ jobs: needs: compare-changes steps: - run: echo "BackendDisable ${{ needs.compare-changes.outputs.backendDisable }}" - - run: printf "should run frontend CI ${{ needs.Compare-changes.outputs.backendDisable == 'false' }}\n" + echo "workflowsDisable ${{ needs.compare-changes.outputs.workflowsDisable }}" + - run: printf "should run frontend CI ${{ needs.Compare-changes.outputs.backendDisable == 'false' || needs.compare-changes.outputs.workflowsDisable == 'false' }}\n" backend-tests: needs: diff --git a/.github/workflows/compare-changes.yml b/.github/workflows/compare-changes.yml index 5a2a247..7d7552f 100644 --- a/.github/workflows/compare-changes.yml +++ b/.github/workflows/compare-changes.yml @@ -3,11 +3,13 @@ on: workflow_call: outputs: backendDisable: - value: ${{ jobs.compare-changes.outputs.backendDisable && jobs.compare-changes.outputs.workflowsDisable }} + value: ${{ jobs.compare-changes.outputs.backendDisable }} frontendDisable: - value: ${{ jobs.compare-changes.outputs.frontendDisable && jobs.compare-changes.outputs.workflowsDisable }} + value: ${{ jobs.compare-changes.outputs.frontendDisable }} + workflowsDisable: + value: ${{ jobs.compare-changes.outputs.workflowsDisable }} playwrightDisable: - value: ${{ jobs.compare-changes.outputs.playwrightDisable && jobs.compare-changes.outputs.workflowsDisable && jobs.compare-changes.outputs.backendDisable && jobs.compare-changes.outputs.frontendDisable }} + value: ${{ jobs.compare-changes.outputs.playwrightDisable && jobs.compare-changes.outputs.backendDisable && jobs.compare-changes.outputs.frontendDisable }} jobs: compare-changes: @@ -32,7 +34,7 @@ jobs: echo "backend disabled ${{ !contains(fromJSON(steps.changed-files.outputs.changes), 'backend') }}\n" echo "frontend disabled ${{ !contains(fromJSON(steps.changed-files.outputs.changes), 'frontend') }}" echo "playwright disabled ${{ !contains(fromJSON(steps.changed-files.outputs.changes), 'playwright') }}" - echo "workflows changed ${{ contains(fromJSON(steps.changed-files.outputs.changes), 'workflows') }}" + echo "workflows disabled ${{ !contains(fromJSON(steps.changed-files.outputs.changes), 'workflows') }}" - name: Check for both frontend and backend changes if: ${{ contains(fromJSON(steps.changed-files.outputs.changes), 'backend') && contains(fromJSON(steps.changed-files.outputs.changes), 'frontend')}} diff --git a/.github/workflows/frontend-workflow.yml b/.github/workflows/frontend-workflow.yml index be2ba74..268db58 100644 --- a/.github/workflows/frontend-workflow.yml +++ b/.github/workflows/frontend-workflow.yml @@ -13,7 +13,8 @@ jobs: needs: compare-changes steps: - run: echo "FrontendDisable ${{ needs.compare-changes.outputs.frontendDisable }}" - - run: printf "should run frontend CI ${{ needs.compare-changes.outputs.frontendDisable == 'false' }}\n" + echo "workflowsDisable ${{ needs.compare-changes.outputs.workflowsDisable }}" + - run: printf "should run frontend CI ${{ needs.compare-changes.outputs.frontendDisable == 'false' || needs.compare-changes.outputs.workflowsDisable == 'false' }}\n" frontend-test: needs: