|
41 | 41 | - cron: "0 3 * * *" |
42 | 42 |
|
43 | 43 | concurrency: |
44 | | - group: full-matrix-tests |
45 | | - cancel-in-progress: false |
| 44 | + group: nightly-${{ github.head_ref || github.ref }}-${{ toJson(inputs) }} |
| 45 | + cancel-in-progress: true |
46 | 46 |
|
47 | 47 | # TODO matrix by workflow (`uses`) - not supported yet by GH |
48 | 48 | jobs: |
49 | | - check-running-workflow: |
50 | | - runs-on: ubuntu-latest |
51 | | - outputs: |
52 | | - is_running: ${{ steps.check.outputs.is_running }} |
53 | | - steps: |
54 | | - - name: Check if the same workflow is running |
55 | | - id: check |
56 | | - uses: actions/github-script@v6 |
57 | | - with: |
58 | | - script: | |
59 | | - const { data } = await github.rest.actions.listWorkflowRuns({ |
60 | | - owner: context.repo.owner, |
61 | | - repo: context.repo.repo, |
62 | | - workflow_id: context.workflow, |
63 | | - status: 'in_progress', |
64 | | - }); |
65 | | -
|
66 | | - const isRunning = data.workflow_runs.some(run => run.id !== context.runId); |
67 | | -
|
68 | | - core.setOutput('is_running', isRunning.toString()); |
69 | | -
|
70 | 49 | check-input: |
71 | 50 | runs-on: ubuntu-latest |
72 | | - needs: check-running-workflow |
73 | | - if: needs.check-running-workflow.outputs.is_running == 'false' |
74 | 51 | steps: |
75 | | - - name: No tests selected |
76 | | - run: echo "No tests selected." |
77 | | - if: github.event_name == 'workflow_dispatch' && inputs.core == 'false' && inputs.java == 'false' && inputs.python == 'false' && inputs.node == 'false' && inputs.csharp == 'false' && inputs.go == 'false' |
| 52 | + - name: no tests selected |
| 53 | + run: false |
| 54 | + if: github.event_name == 'workflow_dispatch' && inputs.core == false && inputs.java == false && inputs.python == false && inputs.node == false && inputs.java == false && inputs.csharp == false && inputs.go == false |
78 | 55 |
|
79 | 56 | run-full-tests-for-core: |
80 | | - needs: check-running-workflow |
81 | | - if: needs.check-running-workflow.outputs.is_running == 'false' && inputs.core == 'true' |
| 57 | + if: (github.repository_owner == 'valkey-io' && github.event_name == 'schedule') || (github.event_name == 'workflow_dispatch' && inputs.core == true) |
82 | 58 | uses: ./.github/workflows/rust.yml |
83 | 59 | name: Run CI for GLIDE core lib |
84 | 60 | secrets: inherit |
85 | 61 |
|
86 | 62 | run-full-tests-for-redis-rs: |
87 | | - needs: check-running-workflow |
88 | | - if: needs.check-running-workflow.outputs.is_running == 'false' && inputs.redis-rs == 'true' |
| 63 | + if: (github.repository_owner == 'valkey-io' && github.event_name == 'schedule') || (github.event_name == 'workflow_dispatch' && inputs.redis-rs == true) |
89 | 64 | uses: ./.github/workflows/redis-rs.yml |
90 | 65 | name: Run CI for Redis-RS client |
91 | 66 | secrets: inherit |
92 | 67 |
|
93 | 68 | run-full-tests-for-java: |
94 | | - needs: check-running-workflow |
95 | | - if: needs.check-running-workflow.outputs.is_running == 'false' && inputs.java == 'true' |
| 69 | + if: (github.repository_owner == 'valkey-io' && github.event_name == 'schedule') || (github.event_name == 'workflow_dispatch' && inputs.java == true) |
96 | 70 | uses: ./.github/workflows/java.yml |
97 | | - name: Run CI for Java client |
| 71 | + name: Run CI for java client |
98 | 72 | secrets: inherit |
99 | 73 |
|
100 | 74 | run-full-tests-for-python: |
101 | | - needs: check-running-workflow |
102 | | - if: needs.check-running-workflow.outputs.is_running == 'false' && inputs.python == 'true' |
| 75 | + if: (github.repository_owner == 'valkey-io' && github.event_name == 'schedule') || (github.event_name == 'workflow_dispatch' && inputs.python == true) |
103 | 76 | uses: ./.github/workflows/python.yml |
104 | | - name: Run CI for Python client |
| 77 | + name: Run CI for python client |
105 | 78 | secrets: inherit |
106 | 79 |
|
107 | 80 | run-full-tests-for-node: |
108 | | - needs: check-running-workflow |
109 | | - if: needs.check-running-workflow.outputs.is_running == 'false' && inputs.node == 'true' |
| 81 | + if: (github.repository_owner == 'valkey-io' && github.event_name == 'schedule') || (github.event_name == 'workflow_dispatch' && inputs.node == true) |
110 | 82 | uses: ./.github/workflows/node.yml |
111 | | - name: Run CI for Node client |
| 83 | + name: Run CI for node client |
112 | 84 | secrets: inherit |
113 | 85 |
|
114 | 86 | run-full-tests-for-csharp: |
115 | | - needs: check-running-workflow |
116 | | - if: needs.check-running-workflow.outputs.is_running == 'false' && inputs.csharp == 'true' |
| 87 | + # C# deactivated in cron, uncomment condition to activate |
| 88 | + #if: (github.repository_owner == 'valkey-io' && github.event_name == 'schedule') || (github.event_name == 'workflow_dispatch' && inputs.csharp == true) |
| 89 | + if: (github.event_name == 'workflow_dispatch' && inputs.csharp == true) |
117 | 90 | uses: ./.github/workflows/csharp.yml |
118 | | - name: Run CI for C# client |
| 91 | + name: Run CI for c# client |
119 | 92 | secrets: inherit |
120 | 93 |
|
121 | 94 | run-full-tests-for-go: |
122 | | - needs: check-running-workflow |
123 | | - if: needs.check-running-workflow.outputs.is_running == 'false' && inputs.go == 'true' |
| 95 | + if: (github.repository_owner == 'valkey-io' && github.event_name == 'schedule') || (github.event_name == 'workflow_dispatch' && inputs.go == true) |
124 | 96 | uses: ./.github/workflows/go.yml |
125 | | - name: Run CI for Go client |
| 97 | + name: Run CI for go client |
126 | 98 | secrets: inherit |
0 commit comments