Skip to content

Commit

Permalink
GitHub actions (#56)
Browse files Browse the repository at this point in the history
  • Loading branch information
kiwiswift authored Nov 12, 2024
1 parent c104508 commit 40be9e5
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/backend-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/compare-changes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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')}}
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/frontend-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 40be9e5

Please sign in to comment.