Skip to content

Commit

Permalink
fixing full matrix action (#2605)
Browse files Browse the repository at this point in the history
Signed-off-by: avifenesh <[email protected]>
  • Loading branch information
avifenesh authored Nov 7, 2024
1 parent 14f4bbc commit a907309
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 49 deletions.
2 changes: 1 addition & 1 deletion .github/json_matrices/supported-languages-versions.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@
{
"language": "go",
"versions": ["1.22.0", "1.18.10"],
"always-run-versions": ["1.22.0"]
"always-run-versions": ["1.22.0", "1.18.10"]
}
]
71 changes: 23 additions & 48 deletions .github/workflows/full-matrix-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ on:
description: "Test GLIDE core"
type: boolean
default: true
# redis-rs:
# description: "Test Redis-RS client"
# type: boolean
# default: true
redis-rs:
description: "Test Redis-RS client"
type: boolean
default: true
node:
description: "Test Node client"
type: boolean
Expand All @@ -41,83 +41,58 @@ on:
- cron: "0 3 * * *"

concurrency:
group: full-matrix-tests
cancel-in-progress: false
group: nightly-${{ github.head_ref || github.ref }}-${{ toJson(inputs) }}
cancel-in-progress: true

# TODO matrix by workflow (`uses`) - not supported yet by GH
jobs:
check-running-workflow:
runs-on: ubuntu-latest
outputs:
is_running: ${{ steps.check.outputs.is_running }}
steps:
- name: Check if the same workflow is running
id: check
uses: actions/github-script@v6
with:
script: |
const { data } = await github.rest.actions.listWorkflowRuns({
owner: context.repo.owner,
repo: context.repo.repo,
workflow_id: context.workflow,
status: 'in_progress',
});
const isRunning = data.workflow_runs.some(run => run.id !== context.runId);
core.setOutput('is_running', isRunning.toString());
check-input:
runs-on: ubuntu-latest
needs: check-running-workflow
if: needs.check-running-workflow.outputs.is_running == 'false'
steps:
- name: No tests selected
run: echo "No tests selected."
if: github.event_name == 'workflow_dispatch' && inputs.core == 'false' && inputs.java == 'false' && inputs.python == 'false' && inputs.node == 'false' && inputs.csharp == 'false' && inputs.go == 'false'
- name: no tests selected
run: false
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

run-full-tests-for-core:
needs: check-running-workflow
if: needs.check-running-workflow.outputs.is_running == 'false' && inputs.core == 'true'
if: (github.repository_owner == 'valkey-io' && github.event_name == 'schedule') || (github.event_name == 'workflow_dispatch' && inputs.core == true)
uses: ./.github/workflows/rust.yml
name: Run CI for GLIDE core lib
secrets: inherit

# run-full-tests-for-redis-rs:
# needs: check-running-workflow
# if: needs.check-running-workflow.outputs.is_running == 'false' && inputs.redis-rs == 'true'
# if: (github.repository_owner == 'valkey-io' && github.event_name == 'schedule') || (github.event_name == 'workflow_dispatch' && inputs.redis-rs == true)
# uses: ./.github/workflows/redis-rs.yml
# name: Run CI for Redis-RS client
# secrets: inherit

run-full-tests-for-java:
needs: check-running-workflow
if: needs.check-running-workflow.outputs.is_running == 'false' && inputs.java == 'true'
if: (github.repository_owner == 'valkey-io' && github.event_name == 'schedule') || (github.event_name == 'workflow_dispatch' && inputs.java == true)
uses: ./.github/workflows/java.yml
name: Run CI for Java client
name: Run CI for java client
secrets: inherit

run-full-tests-for-python:
needs: check-running-workflow
if: needs.check-running-workflow.outputs.is_running == 'false' && inputs.python == 'true'
if: (github.repository_owner == 'valkey-io' && github.event_name == 'schedule') || (github.event_name == 'workflow_dispatch' && inputs.python == true)
uses: ./.github/workflows/python.yml
name: Run CI for Python client
name: Run CI for python client
secrets: inherit

run-full-tests-for-node:
needs: check-running-workflow
if: needs.check-running-workflow.outputs.is_running == 'false' && inputs.node == 'true'
if: (github.repository_owner == 'valkey-io' && github.event_name == 'schedule') || (github.event_name == 'workflow_dispatch' && inputs.node == true)
uses: ./.github/workflows/node.yml
name: Run CI for Node client
name: Run CI for node client
secrets: inherit

run-full-tests-for-csharp:
needs: check-running-workflow
if: needs.check-running-workflow.outputs.is_running == 'false' && inputs.csharp == 'true'
# C# deactivated in cron, uncomment condition to activate
#if: (github.repository_owner == 'valkey-io' && github.event_name == 'schedule') || (github.event_name == 'workflow_dispatch' && inputs.csharp == true)
if: (github.event_name == 'workflow_dispatch' && inputs.csharp == true)
uses: ./.github/workflows/csharp.yml
name: Run CI for C# client
name: Run CI for c# client
secrets: inherit

run-full-tests-for-go:
needs: check-running-workflow
if: needs.check-running-workflow.outputs.is_running == 'false' && inputs.go == 'true'
if: (github.repository_owner == 'valkey-io' && github.event_name == 'schedule') || (github.event_name == 'workflow_dispatch' && inputs.go == true)
uses: ./.github/workflows/go.yml
name: Run CI for Go client
name: Run CI for go client
secrets: inherit

0 comments on commit a907309

Please sign in to comment.