From b43fce18770a20f114214993c02a6252747d93f2 Mon Sep 17 00:00:00 2001 From: Yury-Fridlyand Date: Mon, 4 Nov 2024 18:24:21 -0800 Subject: [PATCH] merge CI from main Signed-off-by: Yury-Fridlyand --- .github/DEVELOPER.md | 144 ++++++++++ .github/ISSUE_TEMPLATE/bug-report.yml | 236 ++++++++-------- .github/ISSUE_TEMPLATE/feature-request.yml | 100 +++---- .github/json_matrices/build-matrix.json | 63 ++--- .github/json_matrices/engine-matrix.json | 26 +- .../supported-languages-versions.json | 29 ++ .github/pull_request_template.md | 14 +- .../workflows/build-node-wrapper/action.yml | 18 +- .../workflows/build-python-wrapper/action.yml | 2 +- .github/workflows/codeql.yml | 6 +- .../workflows/create-test-matrices/action.yml | 80 ++++++ .github/workflows/csharp.yml | 182 +++++++++---- .github/workflows/go.yml | 238 ++++++++-------- .github/workflows/install-engine/action.yml | 102 +++++++ .../install-rust-and-protoc/action.yml | 1 - .../install-shared-dependencies/action.yml | 14 +- .github/workflows/java-cd.yml | 27 +- .github/workflows/java.yml | 157 ++++++----- .github/workflows/lint-rust/action.yml | 8 +- .github/workflows/lint-ts/action.yml | 2 +- .github/workflows/nightly.yml | 88 ++++++ .../node-create-package-file/action.yml | 2 +- .github/workflows/node.yml | 255 ++++++++---------- .github/workflows/npm-cd.yml | 129 +++++---- .github/workflows/ort.yml | 187 +++++++------ .github/workflows/pypi-cd.yml | 28 +- .github/workflows/python.yml | 217 ++++++++------- .github/workflows/run-ort-tools/action.yml | 16 +- .github/workflows/rust.yml | 75 ++++-- .github/workflows/semgrep.yml | 9 +- .../workflows/setup-musl-on-linux/action.yml | 18 +- .../start-self-hosted-runner/action.yml | 6 +- .github/workflows/test-benchmark/action.yml | 3 +- 33 files changed, 1530 insertions(+), 952 deletions(-) create mode 100644 .github/DEVELOPER.md create mode 100644 .github/json_matrices/supported-languages-versions.json create mode 100644 .github/workflows/create-test-matrices/action.yml create mode 100644 .github/workflows/install-engine/action.yml create mode 100644 .github/workflows/nightly.yml diff --git a/.github/DEVELOPER.md b/.github/DEVELOPER.md new file mode 100644 index 0000000000..2acc4ccb68 --- /dev/null +++ b/.github/DEVELOPER.md @@ -0,0 +1,144 @@ +# CI/CD Workflow Guide + +### Overview + +Our CI/CD pipeline tests and builds our project across multiple languages, versions, and environments. This guide outlines the key components and processes of our workflow. + +### Workflow Triggers + +- Pull requests +- Pushes to `main` or release branches (PR merges) +- Scheduled runs (daily) - starts CI pipelines for all clients +- Manual trigger (`workflow_dispatch`) - a developer can start a client's pipeline or the scheduled one to run all pipelines on demand + +Job triggers + +### Test coverage + +There are two levels of testing: the basic one and full (_aka_ `full-matrix`). +Basic amount of testing is executed on every open and merged PR. The full set of tests is executed by the scheduled job. +A developer can select the level when starting a job, either scheduled or client's pipeline. + +Matrices + +### Language-Specific Workflows + +Each language has its own workflow file with similar structure but language-specific steps, for example python.yml for Python, or java.yml for Java. + +### Shared Components + +#### Matrix Files + +While workflows are language-specific, the matrix files are shared across all workflows. +Workflows are starting by loading the matrix files from the `.github/json_matrices` directory. + +- `engine-matrix.json`: Defines the versions of the engine to test against. +- `build-matrix.json`: Defines the host environments for testing. +- `supported-languages-versions.json`: Defines the supported versions of languages. + +All matrices have a `run` like field which specifies if the configuration should be tested on every workflow run. +This allows for flexible control over which configurations are tested in different scenarios, optimizing CI/CD performance and resource usage. + +#### Engine Matrix (engine-matrix.json) + +Defines the versions of Valkey engine to test against: + +```json +[ + { "type": "valkey", "version": "7.2.5", "run": "always" } + // ... other configurations +] +``` + +- `type`: The type of engine (e.g., Valkey, Redis). +- `version`: Specifies the engine version that the workflow should checkout. + For example, "7.2.5" represents a release tag, while "7.0" denotes a branch name. The workflow should use this parameter to checkout the specific release version or branch to build the engine with the appropriate version. +- `run`: Specifies if the engine version should be tested on every workflow. + +#### Build Matrix (build-matrix.json) + +Defines the host environments for testing: + +```json +[ + { + "OS": "ubuntu", + "RUNNER": "ubuntu-latest", + "TARGET": "x86_64-unknown-linux-gnu", + "run": ["always", "python", "node", "java"] + } + // ... other configurations +] +``` + +- `OS`: The operating system of the host. +- `RUNNER`: The GitHub runner to use. +- `TARGET`: The target environment as defined in Rust. To see a list of available targets, run `rustup target list`. +- `run`: Specifies which language workflows should use this host configuration. The value `always` indicates that the configuration should be used for every workflow trigger. + +#### Supported Languages Version (supported-languages-version.json) + +Defines the supported versions of languages: + +```json +[ + { + "language": "java", + "versions": ["11", "17"], + "always-run-versions": ["17"] + } + // ... other configurations +] +``` + +- `language`: The language for which the version is supported. +- `versions`: The full versions supported of the language which will test against scheduled. +- `always-run-versions`: The versions that will always be tested, regardless of the workflow trigger. + +#### Triggering Workflows + +- Push to `main` by merging a PR or create a new pull request to run workflows automatically. +- Use `workflow_dispatch` for manual triggers, accepting a boolean configuration parameter to run all configurations. +- Scheduled runs are triggered daily to ensure regular testing of all configurations. + +### Mutual vs. Language-Specific Components + +#### Mutual + +- Matrix files - `.github/json_matrices/` +- Shared dependencies installation - `.github/workflows/install-shared-dependencies/action.yml` +- Rust linters - `.github/workflows/lint-rust/action.yml` + +#### Language-Specific + +- Package manager commands +- Testing frameworks +- Build processes + +### Customizing Workflows + +Modify `.yml` files to adjust language-specific steps. +Update matrix files to change tested versions or environments. +Adjust cron schedules in workflow files for different timing of scheduled runs. + +### Workflow Matrices + +We use dynamic matrices for our CI/CD workflows, which are created using the `create-test-matrices` action. This action is defined in `.github/workflows/create-test-matrices/action.yml`. + +#### How it works + +1. The action is called with a `language-name` input and `dispatch-run-full-matrix` input. +2. It reads the `engine-matrix.json`, `build-matrix.json`, and `supported-languages-version.json` files. +3. It filters the matrices based on the inputs and the event type. +4. It generates three matrices: + - Engine matrix: Defines the types and versions of the engine to test against, for example Valkey 7.2.5. + - Host matrix: Defines the host platforms to run the tests on, for example Ubuntu on ARM64. + - Language-version matrix: Defines the supported versions of languages, for example python 3.8. + +#### Outputs + +- `engine-matrix-output`: The generated engine matrix. +- `host-matrix-output`: The generated host matrix. +- `language-version-matrix-output`: The generated language version matrix. + +This dynamic matrix generation allows for flexible and efficient CI/CD workflows, adapting the test configurations based on the type of change and the specific language being tested. diff --git a/.github/ISSUE_TEMPLATE/bug-report.yml b/.github/ISSUE_TEMPLATE/bug-report.yml index 5f63253d51..98a018219c 100644 --- a/.github/ISSUE_TEMPLATE/bug-report.yml +++ b/.github/ISSUE_TEMPLATE/bug-report.yml @@ -5,134 +5,134 @@ title: "(topic): (short issue description)" labels: [bug, needs-triage] assignees: [] body: - - type: textarea - id: description - attributes: - label: Describe the bug - description: What is the problem? A clear and concise description of the bug. - validations: - required: true + - type: textarea + id: description + attributes: + label: Describe the bug + description: What is the problem? A clear and concise description of the bug. + validations: + required: true - - type: textarea - id: expected - attributes: - label: Expected Behavior - description: | - What did you expect to happen? - validations: - required: true + - type: textarea + id: expected + attributes: + label: Expected Behavior + description: | + What did you expect to happen? + validations: + required: true - - type: textarea - id: current - attributes: - label: Current Behavior - description: | - What actually happened? - - Please include full errors, uncaught exceptions, stack traces, and relevant logs. - If service responses are relevant, please include wire logs. - validations: - required: true + - type: textarea + id: current + attributes: + label: Current Behavior + description: | + What actually happened? - - type: textarea - id: reproduction - attributes: - label: Reproduction Steps - description: | - Provide a self-contained, concise snippet of code that can be used to reproduce the issue. - For more complex issues provide a repo with the smallest sample that reproduces the bug. - - Avoid including business logic or unrelated code, it makes diagnosis more difficult. - The code sample should be an SSCCE. See http://sscce.org/ for details. In short, please provide a code sample that we can copy/paste, run and reproduce. - validations: - required: true + Please include full errors, uncaught exceptions, stack traces, and relevant logs. + If service responses are relevant, please include wire logs. + validations: + required: true - - type: textarea - id: solution - attributes: - label: Possible Solution - description: | - Suggest a fix/reason for the bug - validations: - required: false + - type: textarea + id: reproduction + attributes: + label: Reproduction Steps + description: | + Provide a self-contained, concise snippet of code that can be used to reproduce the issue. + For more complex issues provide a repo with the smallest sample that reproduces the bug. - - type: textarea - id: context - attributes: - label: Additional Information/Context - description: | - Anything else that might be relevant for troubleshooting this bug. Providing context helps us come up with a solution that is most useful in the real world. - validations: - required: false + Avoid including business logic or unrelated code, it makes diagnosis more difficult. + The code sample should be an SSCCE. See http://sscce.org/ for details. In short, please provide a code sample that we can copy/paste, run and reproduce. + validations: + required: true - - type: input - id: client-version - attributes: - label: Client version used - validations: - required: true + - type: textarea + id: solution + attributes: + label: Possible Solution + description: | + Suggest a fix/reason for the bug + validations: + required: false - - type: input - id: engine-version - attributes: - label: Engine type and version - description: E.g. Valkey 7.0 - validations: - required: true + - type: textarea + id: context + attributes: + label: Additional Information/Context + description: | + Anything else that might be relevant for troubleshooting this bug. Providing context helps us come up with a solution that is most useful in the real world. + validations: + required: false - - type: input - id: operating-system - attributes: - label: OS - validations: - required: true + - type: input + id: client-version + attributes: + label: Client version used + validations: + required: true - - type: dropdown - id: language - attributes: - label: Language - multiple: true - options: - - TypeScript - - Python - - Java - - Rust - - Go - - .Net - validations: - required: true + - type: input + id: engine-version + attributes: + label: Engine type and version + description: E.g. Valkey 7.0 + validations: + required: true - - type: input - id: language-version - attributes: - label: Language Version - description: E.g. TypeScript (5.2.2) | Python (3.9) - validations: - required: true + - type: input + id: operating-system + attributes: + label: OS + validations: + required: true - - type: textarea - id: cluster-info - attributes: - label: Cluster information - description: | - Cluster information, cluster topology, number of shards, number of replicas, used data types. - validations: - required: false + - type: dropdown + id: language + attributes: + label: Language + multiple: true + options: + - TypeScript + - Python + - Java + - Rust + - Go + - .Net + validations: + required: true - - type: textarea - id: logs - attributes: - label: Logs - description: | - Client and/or server logs. - validations: - required: false + - type: input + id: language-version + attributes: + label: Language Version + description: E.g. TypeScript (5.2.2) | Python (3.9) + validations: + required: true - - type: textarea - id: other - attributes: - label: Other information - description: | - e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. associated pull-request, stackoverflow, etc - validations: - required: false + - type: textarea + id: cluster-info + attributes: + label: Cluster information + description: | + Cluster information, cluster topology, number of shards, number of replicas, used data types. + validations: + required: false + + - type: textarea + id: logs + attributes: + label: Logs + description: | + Client and/or server logs. + validations: + required: false + + - type: textarea + id: other + attributes: + label: Other information + description: | + e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. associated pull-request, stackoverflow, etc + validations: + required: false diff --git a/.github/ISSUE_TEMPLATE/feature-request.yml b/.github/ISSUE_TEMPLATE/feature-request.yml index 64684f1d1c..a7607565aa 100644 --- a/.github/ISSUE_TEMPLATE/feature-request.yml +++ b/.github/ISSUE_TEMPLATE/feature-request.yml @@ -5,55 +5,55 @@ title: "(topic): (short issue description)" labels: [feature-request, needs-triage] assignees: [] body: - - type: textarea - id: description - attributes: - label: Describe the feature - description: A clear and concise description of the feature you are proposing. - validations: - required: true - - type: textarea - id: use-case - attributes: - label: Use Case - description: | - Why do you need this feature? - validations: - required: true - - type: textarea - id: solution - attributes: - label: Proposed Solution - description: | - Suggest how to implement the addition or change. Please include prototype/workaround/sketch/reference implementation. - validations: - required: false - - type: textarea - id: other - attributes: - label: Other Information - description: | - Any alternative solutions or features you considered, a more detailed explanation, stack traces, related issues, links for context, etc. - validations: - required: false - - type: checkboxes - id: ack - attributes: - label: Acknowledgements - options: - - label: I may be able to implement this feature request + - type: textarea + id: description + attributes: + label: Describe the feature + description: A clear and concise description of the feature you are proposing. + validations: + required: true + - type: textarea + id: use-case + attributes: + label: Use Case + description: | + Why do you need this feature? + validations: + required: true + - type: textarea + id: solution + attributes: + label: Proposed Solution + description: | + Suggest how to implement the addition or change. Please include prototype/workaround/sketch/reference implementation. + validations: required: false - - label: This feature might incur a breaking change + - type: textarea + id: other + attributes: + label: Other Information + description: | + Any alternative solutions or features you considered, a more detailed explanation, stack traces, related issues, links for context, etc. + validations: required: false - - type: input - id: client-version - attributes: - label: Client version used - validations: - required: true - - type: input - id: environment - attributes: - label: Environment details (OS name and version, etc.) - validations: - required: true + - type: checkboxes + id: ack + attributes: + label: Acknowledgements + options: + - label: I may be able to implement this feature request + required: false + - label: This feature might incur a breaking change + required: false + - type: input + id: client-version + attributes: + label: Client version used + validations: + required: true + - type: input + id: environment + attributes: + label: Environment details (OS name and version, etc.) + validations: + required: true diff --git a/.github/json_matrices/build-matrix.json b/.github/json_matrices/build-matrix.json index fc02093b9f..dff057084b 100644 --- a/.github/json_matrices/build-matrix.json +++ b/.github/json_matrices/build-matrix.json @@ -5,28 +5,19 @@ "RUNNER": "ubuntu-latest", "ARCH": "x64", "TARGET": "x86_64-unknown-linux-gnu", - "PACKAGE_MANAGERS": [ - "pypi", - "npm", - "maven" - ] + "PACKAGE_MANAGERS": ["pypi", "npm", "maven"], + "run": "always", + "languages": ["python", "node", "java", "go", "dotnet"] }, { "OS": "ubuntu", "NAMED_OS": "linux", - "RUNNER": [ - "self-hosted", - "Linux", - "ARM64" - ], + "RUNNER": ["self-hosted", "Linux", "ARM64"], "ARCH": "arm64", "TARGET": "aarch64-unknown-linux-gnu", - "PACKAGE_MANAGERS": [ - "pypi", - "npm", - "maven" - ], - "CONTAINER": "2_28" + "PACKAGE_MANAGERS": ["pypi", "npm", "maven"], + "CONTAINER": "2_28", + "languages": ["python", "node", "java", "go", "dotnet"] }, { "OS": "macos", @@ -34,11 +25,8 @@ "RUNNER": "macos-12", "ARCH": "x64", "TARGET": "x86_64-apple-darwin", - "PACKAGE_MANAGERS": [ - "pypi", - "npm", - "maven" - ] + "PACKAGE_MANAGERS": ["pypi", "npm", "maven"], + "languages": ["python", "node", "java", "go", "dotnet"] }, { "OS": "macos", @@ -46,27 +34,19 @@ "RUNNER": "macos-latest", "ARCH": "arm64", "TARGET": "aarch64-apple-darwin", - "PACKAGE_MANAGERS": [ - "pypi", - "npm", - "maven" - ] + "PACKAGE_MANAGERS": ["pypi", "npm", "maven"], + "languages": ["python", "node", "java", "go", "dotnet"] }, { "OS": "ubuntu", "NAMED_OS": "linux", "ARCH": "arm64", "TARGET": "aarch64-unknown-linux-musl", - "RUNNER": [ - "self-hosted", - "Linux", - "ARM64" - ], + "RUNNER": ["self-hosted", "Linux", "ARM64"], "IMAGE": "node:lts-alpine3.19", "CONTAINER_OPTIONS": "--user root --privileged --rm", - "PACKAGE_MANAGERS": [ - "npm" - ] + "PACKAGE_MANAGERS": ["npm"], + "languages": ["node"] }, { "OS": "ubuntu", @@ -76,8 +56,17 @@ "RUNNER": "ubuntu-latest", "IMAGE": "node:lts-alpine3.19", "CONTAINER_OPTIONS": "--user root --privileged", - "PACKAGE_MANAGERS": [ - "npm" - ] + "PACKAGE_MANAGERS": ["npm"], + "languages": ["node"] + }, + { + "OS": "amazon-linux", + "NAMED_OS": "linux", + "RUNNER": "ubuntu-latest", + "ARCH": "x64", + "TARGET": "x86_64-unknown-linux-gnu", + "IMAGE": "amazonlinux:latest", + "PACKAGE_MANAGERS": [], + "languages": ["python", "node", "java", "go", "dotnet"] } ] diff --git a/.github/json_matrices/engine-matrix.json b/.github/json_matrices/engine-matrix.json index 464aedf31a..06a8a27fd9 100644 --- a/.github/json_matrices/engine-matrix.json +++ b/.github/json_matrices/engine-matrix.json @@ -1,10 +1,20 @@ [ - { - "type": "valkey", - "version": "7.2.5" - }, - { - "type": "valkey", - "version": "8.0.0" - } + { + "type": "valkey", + "version": "8.0", + "run": "always" + }, + { + "type": "valkey", + "version": "7.2" + }, + { + "type": "redis", + "version": "7.0" + }, + { + "type": "redis", + "version": "6.2", + "run": "always" + } ] diff --git a/.github/json_matrices/supported-languages-versions.json b/.github/json_matrices/supported-languages-versions.json new file mode 100644 index 0000000000..60271e7c6d --- /dev/null +++ b/.github/json_matrices/supported-languages-versions.json @@ -0,0 +1,29 @@ +[ + { + "language": "java", + "versions": ["11", "17"], + "always-run-versions": ["17"] + }, + { + "language": "python", + "versions": ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"], + "// always-run-versions": ["3.8", "3.13"], + "always-run-versions": ["3.13"] + }, + { + "language": "node", + "versions": ["16.x", "17.x", "18.x", "19.x", "20.x"], + "// always-run-versions": ["16.x", "20.x"], + "always-run-versions": ["20.x"] + }, + { + "language": "dotnet", + "versions": ["8.0", "6.0"], + "always-run-versions": ["8.0"] + }, + { + "language": "go", + "versions": ["1.22.0", "1.18.10"], + "always-run-versions": ["1.22.0"] + } +] diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 8e6d8dd2b3..ff120235e3 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -7,16 +7,16 @@ here](https://github.com/valkey-io/valkey-glide/blob/main/CONTRIBUTING.md) --> ### Issue link + This Pull Request is linked to issue (URL): [REPLACE ME] ### Checklist Before submitting the PR make sure the following are checked: -* [ ] This Pull Request is related to one issue. -* [ ] Commit message has a detailed description of what changed and why. -* [ ] Tests are added or updated. -* [ ] CHANGELOG.md and documentation files are updated. -* [ ] Destination branch is correct - main or release -* [ ] Commits will be squashed upon merging. - +- [ ] This Pull Request is related to one issue. +- [ ] Commit message has a detailed description of what changed and why. +- [ ] Tests are added or updated. +- [ ] CHANGELOG.md and documentation files are updated. +- [ ] Destination branch is correct - main or release +- [ ] Commits will be squashed upon merging. diff --git a/.github/workflows/build-node-wrapper/action.yml b/.github/workflows/build-node-wrapper/action.yml index aa1200fbd5..9d2f14d59f 100644 --- a/.github/workflows/build-node-wrapper/action.yml +++ b/.github/workflows/build-node-wrapper/action.yml @@ -65,20 +65,20 @@ runs: - name: Create package.json file uses: ./.github/workflows/node-create-package-file with: - release_version: ${{ env.RELEASE_VERSION }} - os: ${{ inputs.os }} - named_os: ${{ inputs.named_os }} - arch: ${{ inputs.arch }} - npm_scope: ${{ inputs.npm_scope }} - target: ${{ inputs.target }} - + release_version: ${{ env.RELEASE_VERSION }} + os: ${{ inputs.os }} + named_os: ${{ inputs.named_os }} + arch: ${{ inputs.arch }} + npm_scope: ${{ inputs.npm_scope }} + target: ${{ inputs.target }} + - name: npm install shell: bash working-directory: ./node run: | - rm -rf node_modules && npm install --frozen-lockfile + rm -rf node_modules && rm -rf package-lock.json && npm install cd rust-client - npm install --frozen-lockfile + rm -rf node_modules && rm -rf package-lock.json && npm install - name: Build shell: bash diff --git a/.github/workflows/build-python-wrapper/action.yml b/.github/workflows/build-python-wrapper/action.yml index 72863c6a43..25c7e20b7d 100644 --- a/.github/workflows/build-python-wrapper/action.yml +++ b/.github/workflows/build-python-wrapper/action.yml @@ -15,7 +15,7 @@ inputs: required: true engine-version: description: "Engine version to install" - required: true + required: false type: string publish: description: "Enable building the wrapper in release mode" diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 36ac59f664..a24c04af12 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -2,21 +2,19 @@ name: "CodeQL" on: push: - branches: + branches: - "main" - "v.?[0-9]+.[0-9]+.[0-9]+" - "v.?[0-9]+.[0-9]+" - "v?[0-9]+.[0-9]+.[0-9]+" - "v?[0-9]+.[0-9]+" - - release-* pull_request: - branches: + branches: - "main" - "v.?[0-9]+.[0-9]+.[0-9]+" - "v.?[0-9]+.[0-9]+" - "v?[0-9]+.[0-9]+.[0-9]+" - "v?[0-9]+.[0-9]+" - - release-* schedule: - cron: "37 18 * * 6" diff --git a/.github/workflows/create-test-matrices/action.yml b/.github/workflows/create-test-matrices/action.yml new file mode 100644 index 0000000000..5bd777b5a1 --- /dev/null +++ b/.github/workflows/create-test-matrices/action.yml @@ -0,0 +1,80 @@ +inputs: + language-name: + description: "Language name" + required: true + type: choice + options: + - java + - node + - python + - go + - C# + run-full-matrix: + description: "Run the full matrix" + required: true + type: boolean + containers: + description: "Run in containers" + required: true + default: false + type: boolean + +outputs: + engine-matrix-output: + description: "Engine matrix" + value: ${{ steps.load-engine-matrix.outputs.engine-matrix }} + host-matrix-output: + description: "Host matrix" + value: ${{ steps.load-host-matrix.outputs.host-matrix }} + version-matrix-output: + description: "Version matrix" + value: ${{ steps.create-lang-version-matrix.outputs.version-matrix }} + +runs: + using: "composite" + steps: + - name: Load engine matrix + id: load-engine-matrix + shell: bash + run: | + set -o pipefail + echo 'Select server engines to run tests against' + if [[ "${{ github.event_name }}" == "pull_request" || "${{ github.event_name }}" == "push" || "${{ inputs.run-full-matrix }}" == "false" ]]; then + echo 'Pick engines marked as `"run": "always"` only - on PR, push or manually triggered job which does not require full matrix' + jq -c '[.[] | select(.run == "always")]' < .github/json_matrices/engine-matrix.json | awk '{ printf "engine-matrix=%s\n", $1 }' | tee -a $GITHUB_OUTPUT + else + echo 'Pick all engines - on cron (schedule) or if manually triggered job requires a full matrix' + jq -c . < .github/json_matrices/engine-matrix.json | awk '{ printf "engine-matrix=%s\n", $1 }' | tee -a $GITHUB_OUTPUT + fi + cat $GITHUB_OUTPUT + + - name: Load host matrix + id: load-host-matrix + shell: bash + run: | + set -o pipefail + [[ "${{ inputs.containers }}" == "true" ]] && CONDITION=".IMAGE?" || CONDITION=".IMAGE == null" + echo 'Select runners (VMs) to run tests on' + if [[ "${{ github.event_name }}" == "pull_request" || "${{ github.event_name }}" == "push" || "${{ inputs.run-full-matrix }}" == "false" ]]; then + echo 'Pick runners marked as '"run": "always"' only - on PR, push or manually triggered job which does not require full matrix' + jq -c '[.[] | select(.run == "always")]' < .github/json_matrices/build-matrix.json | awk '{ printf "host-matrix=%s\n", $1 }' | tee -a $GITHUB_OUTPUT + else + echo 'Pick all runners assigned for the chosen client (language) - on cron (schedule) or if manually triggered job requires a full matrix' + jq -c "[.[] | select(.languages? and any(.languages[] == \"${{ inputs.language-name }}\"; .) and $CONDITION)]" < .github/json_matrices/build-matrix.json | awk '{ printf "host-matrix=%s\n", $1 }' | tee -a $GITHUB_OUTPUT + fi + cat $GITHUB_OUTPUT + + - name: Create language version matrix + id: create-lang-version-matrix + shell: bash + run: | + set -o pipefail + echo 'Select language (framework/SDK) versions to run tests on' + if [[ "${{ github.event_name }}" == "pull_request" || "${{ github.event_name }}" == "push" || "${{ inputs.run-full-matrix }}" == "false" ]]; then + echo 'Pick language versions listed in 'always-run-versions' only - on PR, push or manually triggered job which does not require full matrix' + jq -c '[.[] | select(.language == "${{ inputs.language-name }}") | .["always-run-versions"]][0] // []' < .github/json_matrices/supported-languages-versions.json | awk '{ printf "version-matrix=%s\n", $1 }' | tee -a $GITHUB_OUTPUT + else + echo 'Pick language versions listed in 'versions' - on cron (schedule) or if manually triggered job requires a full matrix' + jq -c '[.[] | select(.language == "${{ inputs.language-name }}") | .versions][0]' < .github/json_matrices/supported-languages-versions.json | awk '{ printf "version-matrix=%s\n", $1 }' | tee -a $GITHUB_OUTPUT + fi + cat $GITHUB_OUTPUT diff --git a/.github/workflows/csharp.yml b/.github/workflows/csharp.yml index eab61c6dc1..100efee036 100644 --- a/.github/workflows/csharp.yml +++ b/.github/workflows/csharp.yml @@ -9,80 +9,92 @@ on: paths: - csharp/** - glide-core/src/** - - glide-core/redis-rs/redis/src/** + - utils/cluster_manager.py + - submodules/** - .github/workflows/csharp.yml - .github/workflows/install-shared-dependencies/action.yml - .github/workflows/test-benchmark/action.yml - .github/workflows/lint-rust/action.yml - - .github/workflows/install-valkey/action.yml - - .github/json_matrices/build-matrix.json + - .github/workflows/install-engine/action.yml + - .github/workflows/create-test-matrices/action.yml + - .github/json_matrices/** pull_request: paths: - csharp/** - glide-core/src/** - - glide-core/redis-rs/redis/src/** + - submodules/** + - utils/cluster_manager.py - .github/workflows/csharp.yml - .github/workflows/install-shared-dependencies/action.yml - .github/workflows/test-benchmark/action.yml - .github/workflows/lint-rust/action.yml - - .github/workflows/install-valkey/action.yml - - .github/json_matrices/build-matrix.json + - .github/workflows/install-engine/action.yml + - .github/workflows/create-test-matrices/action.yml + - .github/json_matrices/** workflow_dispatch: + inputs: + full-matrix: + description: "Run the full engine, host, and language version matrix" + type: boolean + default: false + name: + required: false + type: string + description: "(Optional) Test run name" + + workflow_call: permissions: contents: read concurrency: - group: C#-${{ github.head_ref || github.ref }} + group: C#-${{ github.head_ref || github.ref }}-${{ toJson(inputs) }} cancel-in-progress: true +run-name: + # Set custom name if job is started manually and name is given + ${{ github.event_name == 'workflow_dispatch' && (inputs.name == '' && format('{0} @ {1} {2}', github.ref_name, github.sha, toJson(inputs)) || inputs.name) || '' }} + +env: + CARGO_TERM_COLOR: always + jobs: - load-engine-matrix: + get-matrices: runs-on: ubuntu-latest outputs: - matrix: ${{ steps.load-engine-matrix.outputs.matrix }} + engine-matrix-output: ${{ steps.get-matrices.outputs.engine-matrix-output }} + host-matrix-output: ${{ steps.get-matrices.outputs.host-matrix-output }} + version-matrix-output: ${{ steps.get-matrices.outputs.version-matrix-output }} steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Load the engine matrix - id: load-engine-matrix - shell: bash - run: echo "matrix=$(jq -c . < .github/json_matrices/engine-matrix.json)" >> $GITHUB_OUTPUT - - run-tests: - needs: load-engine-matrix - timeout-minutes: 25 + - uses: actions/checkout@v4 + - id: get-matrices + uses: ./.github/workflows/create-test-matrices + with: + language-name: dotnet + # Run full test matrix if job started by cron or it was explictly specified by a person who triggered the workflow + run-full-matrix: ${{ github.event.inputs.full-matrix == 'true' || github.event_name == 'schedule' }} + + test-csharp: + needs: get-matrices + timeout-minutes: 35 strategy: fail-fast: false matrix: - engine: ${{ fromJson(needs.load-engine-matrix.outputs.matrix) }} - dotnet: - # - '6.0' - - '8.0' - host: - - { - OS: ubuntu, - RUNNER: ubuntu-latest, - TARGET: x86_64-unknown-linux-gnu - } - # - { - # OS: macos, - # RUNNER: macos-latest, - # TARGET: aarch64-apple-darwin - # } - + dotnet: ${{ fromJson(needs.get-matrices.outputs.version-matrix-output) }} + engine: ${{ fromJson(needs.get-matrices.outputs.engine-matrix-output) }} + host: ${{ fromJson(needs.get-matrices.outputs.host-matrix-output) }} runs-on: ${{ matrix.host.RUNNER }} steps: - uses: actions/checkout@v4 - + with: + submodules: recursive - name: Set up dotnet ${{ matrix.dotnet }} uses: actions/setup-dotnet@v4 with: dotnet-version: ${{ matrix.dotnet }} - + - name: Install shared software dependencies uses: ./.github/workflows/install-shared-dependencies with: @@ -91,12 +103,8 @@ jobs: github-token: ${{ secrets.GITHUB_TOKEN }} engine-version: ${{ matrix.engine.version }} - - name: Format - working-directory: ./csharp - run: dotnet format --verify-no-changes --verbosity diagnostic - - name: Test dotnet ${{ matrix.dotnet }} - working-directory: ./csharp + working-directory: csharp run: dotnet test --framework net${{ matrix.dotnet }} "-l:html;LogFileName=TestReport.html" --results-directory . -warnaserror - uses: ./.github/workflows/test-benchmark @@ -108,21 +116,97 @@ jobs: continue-on-error: true uses: actions/upload-artifact@v4 with: - name: test-reports-dotnet-${{ matrix.dotnet }}-redis-${{ matrix.redis }}-${{ matrix.host.RUNNER }} + name: test-reports-dotnet-${{ matrix.dotnet }}-${{ matrix.engine.type }}-${{ matrix.engine.version }}-${{ matrix.host.RUNNER }} path: | csharp/TestReport.html benchmarks/results/* utils/clusters/** -# TODO Add amazonlinux + get-containers: + runs-on: ubuntu-latest + if: ${{ github.event.inputs.full-matrix == 'true' || github.event_name == 'schedule' }} + outputs: + engine-matrix-output: ${{ steps.get-matrices.outputs.engine-matrix-output }} + host-matrix-output: ${{ steps.get-matrices.outputs.host-matrix-output }} + version-matrix-output: ${{ steps.get-matrices.outputs.version-matrix-output }} + + steps: + - uses: actions/checkout@v4 + - id: get-matrices + uses: ./.github/workflows/create-test-matrices + with: + language-name: dotnet + run-full-matrix: true + containers: true + + test-csharp-container: + runs-on: ${{ matrix.host.RUNNER }} + needs: [get-containers] + timeout-minutes: 25 + strategy: + fail-fast: false + matrix: + # Don't use generated matrix for dotnet until net6.0 compatibility issues resolved on amazon linux + # dotnet: ${{ fromJson(needs.get-containers.outputs.version-matrix-output) }} + dotnet: ["8.0"] + engine: ${{ fromJson(needs.get-containers.outputs.engine-matrix-output) }} + host: ${{ fromJson(needs.get-containers.outputs.host-matrix-output) }} + container: + image: ${{ matrix.host.IMAGE }} + options: ${{ join(' -q ', matrix.host.CONTAINER_OPTIONS) }} # adding `-q` to bypass empty options + steps: + - name: Install git + run: | + yum update + yum install -y git tar findutils libicu + echo IMAGE=amazonlinux:latest | sed -r 's/:/-/g' >> $GITHUB_ENV + # Replace `:` in the variable otherwise it can't be used in `upload-artifact` + - uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Set up dotnet ${{ matrix.dotnet }} + uses: actions/setup-dotnet@v4 + with: + dotnet-version: ${{ matrix.dotnet }} + + - name: Install shared software dependencies + uses: ./.github/workflows/install-shared-dependencies + with: + os: ${{ matrix.host.OS }} + target: ${{ matrix.host.TARGET }} + github-token: ${{ secrets.GITHUB_TOKEN }} + engine-version: ${{ matrix.engine.version }} - lint-rust: + - name: Test dotnet ${{ matrix.dotnet }} + working-directory: csharp + run: dotnet test --framework net${{ matrix.dotnet }} "-l:html;LogFileName=TestReport.html" --results-directory . -warnaserror + + - name: Upload test reports + if: always() + continue-on-error: true + uses: actions/upload-artifact@v4 + with: + name: test-reports-dotnet-${{ matrix.dotnet }}-${{ matrix.engine.type }}-${{ matrix.engine.version }}-${{ env.IMAGE }}-${{ matrix.host.ARCH }} + path: | + csharp/TestReport.html + benchmarks/results/* + utils/clusters/** + + lint: timeout-minutes: 10 runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - + with: + submodules: recursive - - uses: ./.github/workflows/lint-rust + - name: lint rust + uses: ./.github/workflows/lint-rust with: - cargo-toml-folder: ./csharp/lib + cargo-toml-folder: csharp/lib + github-token: ${{ secrets.GITHUB_TOKEN }} + + - name: Format + working-directory: csharp + run: dotnet format --verify-no-changes --verbosity diagnostic diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 3290839a6a..f7bf6c06da 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -8,72 +8,84 @@ on: - v* paths: - glide-core/src/** - - glide-core/redis-rs/redis/src/** + - submodules/** + - utils/cluster_manager.py - go/** - .github/workflows/go.yml - .github/workflows/install-shared-dependencies/action.yml - .github/workflows/test-benchmark/action.yml - .github/workflows/lint-rust/action.yml - - .github/workflows/install-valkey/action.yml - - .github/json_matrices/build-matrix.json + - .github/workflows/install-engine/action.yml + - .github/workflows/create-test-matrices/action.yml + - .github/json_matrices/** pull_request: paths: - glide-core/src/** - - glide-core/redis-rs/redis/src/** + - submodules/** + - utils/cluster_manager.py - go/** - .github/workflows/go.yml - .github/workflows/install-shared-dependencies/action.yml - .github/workflows/test-benchmark/action.yml - .github/workflows/lint-rust/action.yml - - .github/workflows/install-valkey/action.yml - - .github/json_matrices/build-matrix.json + - .github/workflows/install-engine/action.yml + - .github/workflows/create-test-matrices/action.yml + - .github/json_matrices/** workflow_dispatch: + inputs: + full-matrix: + description: "Run the full engine, host, and language version matrix" + type: boolean + default: false + name: + required: false + type: string + description: "(Optional) Test run name" + + workflow_call: concurrency: - group: go-${{ github.head_ref || github.ref }} + group: go-${{ github.head_ref || github.ref }}-${{ toJson(inputs) }} cancel-in-progress: true +run-name: + # Set custom name if job is started manually and name is given + ${{ github.event_name == 'workflow_dispatch' && (inputs.name == '' && format('{0} @ {1} {2}', github.ref_name, github.sha, toJson(inputs)) || inputs.name) || '' }} + +env: + CARGO_TERM_COLOR: always + jobs: - load-engine-matrix: - runs-on: ubuntu-latest - outputs: - matrix: ${{ steps.load-engine-matrix.outputs.matrix }} - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Load the engine matrix - id: load-engine-matrix - shell: bash - run: echo "matrix=$(jq -c . < .github/json_matrices/engine-matrix.json)" >> $GITHUB_OUTPUT - - build-and-test-go-client: - needs: load-engine-matrix + get-matrices: + runs-on: ubuntu-latest + outputs: + engine-matrix-output: ${{ steps.get-matrices.outputs.engine-matrix-output }} + host-matrix-output: ${{ steps.get-matrices.outputs.host-matrix-output }} + version-matrix-output: ${{ steps.get-matrices.outputs.version-matrix-output }} + steps: + - uses: actions/checkout@v4 + - id: get-matrices + uses: ./.github/workflows/create-test-matrices + with: + language-name: go + # Run full test matrix if job started by cron or it was explictly specified by a person who triggered the workflow + run-full-matrix: ${{ github.event.inputs.full-matrix == 'true' || github.event_name == 'schedule' }} + + test-go: + needs: get-matrices timeout-minutes: 35 strategy: - # Run all jobs fail-fast: false matrix: - go: - - '1.22.0' - engine: ${{ fromJson(needs.load-engine-matrix.outputs.matrix) }} - host: - - { - OS: ubuntu, - RUNNER: ubuntu-latest, - TARGET: x86_64-unknown-linux-gnu - } - # - { - # OS: macos, - # RUNNER: macos-latest, - # TARGET: aarch64-apple-darwin - # } - + go: ${{ fromJson(needs.get-matrices.outputs.version-matrix-output) }} + engine: ${{ fromJson(needs.get-matrices.outputs.engine-matrix-output) }} + host: ${{ fromJson(needs.get-matrices.outputs.host-matrix-output) }} runs-on: ${{ matrix.host.RUNNER }} steps: - uses: actions/checkout@v4 - + with: + submodules: recursive - name: Set up Go ${{ matrix.go }} uses: actions/setup-go@v5 @@ -101,14 +113,9 @@ jobs: working-directory: ./go run: make build - - name: Run linters - working-directory: ./go - run: make lint-ci - - name: Run tests working-directory: ./go - run: | - make test + run: make test - uses: ./.github/workflows/test-benchmark with: @@ -119,93 +126,108 @@ jobs: continue-on-error: true uses: actions/upload-artifact@v4 with: - name: reports-go-${{ matrix.go }}-redis-${{ matrix.redis }}-${{ matrix.os }} + name: test-report-go-${{ matrix.go }}-${{ matrix.engine.type }}-${{ matrix.engine.version }}-${{ matrix.host.RUNNER }} path: | utils/clusters/** benchmarks/results/** - build-amazonlinux-latest: - if: github.repository_owner == 'valkey-io' + lint: + timeout-minutes: 10 + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + submodules: recursive + + - uses: ./.github/workflows/lint-rust + with: + cargo-toml-folder: go + github-token: ${{ secrets.GITHUB_TOKEN }} + + - name: Set up Go ${{ matrix.go }} + uses: actions/setup-go@v5 + with: + go-version: "1.22.0" + cache-dependency-path: go/go.sum + + - name: Install protoc + uses: ./.github/workflows/install-rust-and-protoc + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + + - name: Install and run linters + working-directory: go + run: | + make install-dev-tools install-build-tools build lint-ci + + get-containers: + runs-on: ubuntu-latest + if: ${{ github.event.inputs.full-matrix == 'true' || github.event_name == 'schedule' }} + outputs: + engine-matrix-output: ${{ steps.get-matrices.outputs.engine-matrix-output }} + host-matrix-output: ${{ steps.get-matrices.outputs.host-matrix-output }} + version-matrix-output: ${{ steps.get-matrices.outputs.version-matrix-output }} + + steps: + - uses: actions/checkout@v4 + - id: get-matrices + uses: ./.github/workflows/create-test-matrices + with: + language-name: go + run-full-matrix: true + containers: true + + test-go-container: + runs-on: ${{ matrix.host.RUNNER }} + needs: [get-containers] + timeout-minutes: 25 strategy: - # Run all jobs fail-fast: false matrix: - go: - - 1.22.0 - runs-on: ubuntu-latest - container: amazonlinux:latest - timeout-minutes: 15 + go: ${{ fromJson(needs.get-containers.outputs.version-matrix-output) }} + engine: ${{ fromJson(needs.get-containers.outputs.engine-matrix-output) }} + host: ${{ fromJson(needs.get-containers.outputs.host-matrix-output) }} + container: + image: ${{ matrix.host.IMAGE }} + options: ${{ join(' -q ', matrix.host.CONTAINER_OPTIONS) }} # adding `-q` to bypass empty options steps: - name: Install git run: | - yum -y remove git - yum -y remove git-* - yum -y install https://packages.endpointdev.com/rhel/7/os/x86_64/endpoint-repo.x86_64.rpm yum update - yum install -y git - git --version - + yum install -y git tar + git config --global --add safe.directory "$GITHUB_WORKSPACE" + echo IMAGE=amazonlinux:latest | sed -r 's/:/-/g' >> $GITHUB_ENV + # Replace `:` in the variable otherwise it can't be used in `upload-artifact` - uses: actions/checkout@v4 + with: + submodules: recursive - - name: Checkout submodules - run: | - git config --global --add safe.directory "$GITHUB_WORKSPACE" - git submodule update --init --recursive + - name: Set up Go ${{ matrix.go }} + uses: actions/setup-go@v5 + with: + go-version: ${{ matrix.go }} + cache-dependency-path: go/go.sum - name: Install shared software dependencies uses: ./.github/workflows/install-shared-dependencies with: - os: "amazon-linux" - target: "x86_64-unknown-linux-gnu" + os: ${{ matrix.host.OS }} + target: ${{ matrix.host.TARGET }} github-token: ${{ secrets.GITHUB_TOKEN }} - engine-version: "7.2.5" - - - name: Install Go - run: | - yum -y install wget - yum -y install tar - wget https://go.dev/dl/go${{ matrix.go }}.linux-amd64.tar.gz - tar -C /usr/local -xzf go${{ matrix.go }}.linux-amd64.tar.gz - echo "/usr/local/go/bin" >> $GITHUB_PATH - echo "$HOME/go/bin" >> $GITHUB_PATH - - - name: Install tools for Go ${{ matrix.go }} - working-directory: ./go - run: make install-tools-go${{ matrix.go }} - - - name: Set LD_LIBRARY_PATH - run: echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$GITHUB_WORKSPACE/go/target/release/deps/" >> $GITHUB_ENV - - - name: Build client - working-directory: ./go - run: make build - - - name: Run linters - working-directory: ./go - run: make lint-ci + engine-version: ${{ matrix.engine.version }} - - name: Run tests - working-directory: ./go + - name: Install & build & test + working-directory: go run: | - make test + LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$GITHUB_WORKSPACE/go/target/release/deps/ + make install-tools-go${{ matrix.go }} build test - - name: Upload cluster manager logs + - name: Upload test reports if: always() continue-on-error: true uses: actions/upload-artifact@v4 with: - name: cluster-manager-logs-${{ matrix.go }}-redis-6-amazonlinux + name: test-reports-go-${{ matrix.go }}-${{ matrix.engine.type }}-${{ matrix.engine.version }}-${{ env.IMAGE }}-${{ matrix.host.ARCH }} path: | utils/clusters/** - - lint-rust: - timeout-minutes: 15 - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - - uses: ./.github/workflows/lint-rust - with: - cargo-toml-folder: ./go - name: lint go rust + benchmarks/results/** diff --git a/.github/workflows/install-engine/action.yml b/.github/workflows/install-engine/action.yml new file mode 100644 index 0000000000..6f28e02d11 --- /dev/null +++ b/.github/workflows/install-engine/action.yml @@ -0,0 +1,102 @@ +name: Install Engine + +inputs: + engine-version: + description: "Engine version to install" + required: true + type: string + target: + description: "Specified target toolchain, ex. x86_64-unknown-linux-gnu" + type: string + required: true + options: + - x86_64-unknown-linux-gnu + - aarch64-unknown-linux-gnu + - x86_64-apple-darwin + - aarch64-apple-darwin + - aarch64-unknown-linux-musl + - x86_64-unknown-linux-musl + +env: + CARGO_TERM_COLOR: always + +runs: + using: "composite" + + # TODO: self-hosted runners are actually cloning the repo, using the cache from the previous run + # will not work as expected. We need to find a way to cache the valkey repo on the runner itself. + steps: + - name: Cache Valkey + if: ${{!contains(inputs.target, 'aarch64-unknown') }} + uses: actions/cache@v4 + id: cache-valkey + with: + path: | + ~/valkey + key: valkey-${{ inputs.engine-version }}-${{ inputs.target }} + + - name: Build Valkey for ARM + if: ${{ contains(inputs.target, 'aarch64-unknown') }} + shell: bash + working-directory: ~ + run: | + cd ~ + echo "Building valkey ${{ inputs.engine-version }}" + # check if the valkey repo is already cloned + if [[ ! -d valkey ]]; then + git clone https://github.com/valkey-io/valkey.git + else + # check if the branch=version is already checked out + if [[ $(git branch --show-current) != ${{ inputs.engine-version }} ]]; then + cd valkey + make clean + make distclean + sudo rm -rf /usr/local/bin/redis-* /usr/local/bin/valkey-* ./valkey-* ./redis-* ./dump.rdb + git fetch --all + git checkout ${{ inputs.engine-version }} + git pull + fi + fi + # if no cache hit, build the engine + - name: Build Valkey + if: ${{ steps.cache-valkey.outputs.cache-hit != 'true' && !contains(inputs.target, 'aarch64-unknown') }} + shell: bash + run: | + echo "Building valkey ${{ inputs.engine-version }}" + cd ~ + git clone https://github.com/valkey-io/valkey.git + cd valkey + git checkout ${{ inputs.engine-version }} + + - name: Install engine + shell: bash + run: | + cd ~/valkey + make BUILD_TLS=yes + if command -v sudo &> /dev/null + then + echo "sudo command exists" + sudo make install + else + echo "sudo command does not exist" + make install + fi + echo 'export PATH=/usr/local/bin:$PATH' >>~/.bash_profile + + # TODO: This seems redundant to me. Is it necessary? Do we check that the Python we install is the correct version? + # Why here and not elsewhere? All Git git repos were created equal + - name: Verify Valkey installation and symlinks + if: ${{ !contains(inputs.engine-version, '-rc') }} + shell: bash + run: | + # In Valkey releases, the engine is built with symlinks from valkey-server and valkey-cli + # to redis-server and redis-cli. This step ensures that the engine is properly installed + # with the expected version and that Valkey symlinks are correctly created. + EXPECTED_VERSION=`echo ${{ inputs.engine-version }} | sed -e "s/^redis-//"` + INSTALLED_VER=$(redis-server -v) + if [[ $INSTALLED_VER != *"${EXPECTED_VERSION}"* ]]; then + echo "Wrong version has been installed. Expected: $EXPECTED_VERSION, Installed: $INSTALLED_VER" + exit 1 + else + echo "Successfully installed the server: $INSTALLED_VER" + fi diff --git a/.github/workflows/install-rust-and-protoc/action.yml b/.github/workflows/install-rust-and-protoc/action.yml index e1222ffd9d..31987ba04a 100644 --- a/.github/workflows/install-rust-and-protoc/action.yml +++ b/.github/workflows/install-rust-and-protoc/action.yml @@ -16,7 +16,6 @@ inputs: type: string required: true - runs: using: "composite" steps: diff --git a/.github/workflows/install-shared-dependencies/action.yml b/.github/workflows/install-shared-dependencies/action.yml index ed065e9840..57647f3211 100644 --- a/.github/workflows/install-shared-dependencies/action.yml +++ b/.github/workflows/install-shared-dependencies/action.yml @@ -25,12 +25,12 @@ inputs: description: "Engine version to install" required: false type: string + github-token: description: "GITHUB_TOKEN, GitHub App installation access token" required: true type: string - runs: using: "composite" steps: @@ -47,7 +47,7 @@ runs: run: | sudo apt update -y sudo apt install -y git gcc pkg-config openssl libssl-dev - + - name: Install software dependencies for Ubuntu MUSL shell: bash if: "${{ contains(inputs.target, 'musl') }}" @@ -67,12 +67,12 @@ runs: if: "${{ !contains(inputs.target, 'musl') }}" uses: ./.github/workflows/install-rust-and-protoc with: - target: ${{ inputs.target }} - github-token: ${{ inputs.github-token }} + target: ${{ inputs.target }} + github-token: ${{ inputs.github-token }} - - name: Install Valkey - if: ${{ inputs.engine-version != '' }} - uses: ./.github/workflows/install-valkey + - name: Install engine + if: "${{ inputs.engine-version }}" + uses: ./.github/workflows/install-engine with: engine-version: ${{ inputs.engine-version }} target: ${{ inputs.target }} diff --git a/.github/workflows/java-cd.yml b/.github/workflows/java-cd.yml index d3f2038313..6f21a2a517 100644 --- a/.github/workflows/java-cd.yml +++ b/.github/workflows/java-cd.yml @@ -86,7 +86,8 @@ jobs: echo "No cleaning needed" fi - uses: actions/checkout@v4 - + with: + submodules: recursive - name: Set up JDK uses: actions/setup-java@v4 @@ -211,7 +212,12 @@ jobs: exit 1 test-deployment-on-all-architectures: - needs: [set-release-version, load-platform-matrix, publish-to-maven-central-deployment] + needs: + [ + set-release-version, + load-platform-matrix, + publish-to-maven-central-deployment, + ] env: JAVA_VERSION: "11" RELEASE_VERSION: ${{ needs.set-release-version.outputs.RELEASE_VERSION }} @@ -224,7 +230,8 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 - + with: + submodules: recursive - name: Set up JDK uses: actions/setup-java@v4 @@ -236,7 +243,7 @@ jobs: uses: ./.github/workflows/install-shared-dependencies with: os: ${{ matrix.host.OS }} - engine-version: "7.2.5" + engine-version: "7.2" target: ${{ matrix.host.TARGET }} github-token: ${{ secrets.GITHUB_TOKEN }} @@ -265,7 +272,11 @@ jobs: publish-release-to-maven: if: ${{ inputs.maven_publish == true || github.event_name == 'push' }} - needs: [publish-to-maven-central-deployment, test-deployment-on-all-architectures] + needs: + [ + publish-to-maven-central-deployment, + test-deployment-on-all-architectures, + ] runs-on: ubuntu-latest environment: AWS_ACTIONS env: @@ -279,7 +290,11 @@ jobs: drop-deployment-if-validation-fails: if: ${{ failure() }} - needs: [publish-to-maven-central-deployment, test-deployment-on-all-architectures] + needs: + [ + publish-to-maven-central-deployment, + test-deployment-on-all-architectures, + ] runs-on: ubuntu-latest env: DEPLOYMENT_ID: ${{ needs.publish-to-maven-central-deployment.outputs.DEPLOYMENT_ID }} diff --git a/.github/workflows/java.yml b/.github/workflows/java.yml index 2c31562f78..b8bbea0f8b 100644 --- a/.github/workflows/java.yml +++ b/.github/workflows/java.yml @@ -8,73 +8,83 @@ on: - v* paths: - glide-core/src/** - - glide-core/redis-rs/redis/src/** + - submodules/** - java/** + - utils/cluster_manager.py - .github/workflows/java.yml - .github/workflows/install-shared-dependencies/action.yml - .github/workflows/test-benchmark/action.yml - .github/workflows/lint-rust/action.yml - - .github/workflows/install-valkey/action.yml - - .github/json_matrices/build-matrix.json + - .github/workflows/install-engine/action.yml + - .github/workflows/create-test-matrices/action.yml + - .github/json_matrices/** + pull_request: paths: - glide-core/src/** - - glide-core/redis-rs/redis/src/** + - submodules/** - java/** + - utils/cluster_manager.py - .github/workflows/java.yml - .github/workflows/install-shared-dependencies/action.yml - .github/workflows/test-benchmark/action.yml - .github/workflows/lint-rust/action.yml - - .github/workflows/install-valkey/action.yml - - .github/json_matrices/build-matrix.json + - .github/workflows/install-engine/action.yml + - .github/workflows/create-test-matrices/action.yml + - .github/json_matrices/** + workflow_dispatch: + inputs: + full-matrix: + description: "Run the full engine, host, and language version matrix" + type: boolean + default: false + name: + required: false + type: string + description: "(Optional) Test run name" + + workflow_call: concurrency: - group: java-${{ github.head_ref || github.ref }} + group: java-${{ github.head_ref || github.ref }}-${{ toJson(inputs) }} cancel-in-progress: true +run-name: + # Set custom name if job is started manually and name is given + ${{ github.event_name == 'workflow_dispatch' && (inputs.name == '' && format('{0} @ {1} {2}', github.ref_name, github.sha, toJson(inputs)) || inputs.name) || '' }} + jobs: - load-engine-matrix: + get-matrices: runs-on: ubuntu-latest outputs: - matrix: ${{ steps.load-engine-matrix.outputs.matrix }} + engine-matrix-output: ${{ steps.get-matrices.outputs.engine-matrix-output }} + host-matrix-output: ${{ steps.get-matrices.outputs.host-matrix-output }} + version-matrix-output: ${{ steps.get-matrices.outputs.version-matrix-output }} steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Load the engine matrix - id: load-engine-matrix - shell: bash - run: echo "matrix=$(jq -c . < .github/json_matrices/engine-matrix.json)" >> $GITHUB_OUTPUT + - uses: actions/checkout@v4 + - id: get-matrices + uses: ./.github/workflows/create-test-matrices + with: + language-name: java + # Run full test matrix if job started by cron or it was explictly specified by a person who triggered the workflow + run-full-matrix: ${{ github.event.inputs.full-matrix == 'true' || github.event_name == 'schedule' }} - build-and-test-java-client: - needs: load-engine-matrix + test-java: + needs: get-matrices timeout-minutes: 35 strategy: - # Run all jobs fail-fast: false matrix: - java: - # - 11 - - 17 - engine: ${{ fromJson(needs.load-engine-matrix.outputs.matrix) }} - host: - - { - OS: ubuntu, - RUNNER: ubuntu-latest, - TARGET: x86_64-unknown-linux-gnu, - } - # - { - # OS: macos, - # RUNNER: macos-latest, - # TARGET: aarch64-apple-darwin - # } - + java: ${{ fromJson(needs.get-matrices.outputs.version-matrix-output) }} + engine: ${{ fromJson(needs.get-matrices.outputs.engine-matrix-output) }} + host: ${{ fromJson(needs.get-matrices.outputs.host-matrix-output) }} runs-on: ${{ matrix.host.RUNNER }} steps: - uses: actions/checkout@v4 - + with: + submodules: recursive - uses: gradle/actions/wrapper-validation@v3 @@ -123,42 +133,54 @@ jobs: benchmarks/results/** java/client/build/reports/spotbugs/** - build-amazonlinux-latest: - if: github.repository_owner == 'valkey-io' + get-containers: + runs-on: ubuntu-latest + if: ${{ github.event.inputs.full-matrix == 'true' || github.event_name == 'schedule' }} + outputs: + engine-matrix-output: ${{ steps.get-matrices.outputs.engine-matrix-output }} + host-matrix-output: ${{ steps.get-matrices.outputs.host-matrix-output }} + version-matrix-output: ${{ steps.get-matrices.outputs.version-matrix-output }} + + steps: + - uses: actions/checkout@v4 + - id: get-matrices + uses: ./.github/workflows/create-test-matrices + with: + language-name: java + run-full-matrix: true + containers: true + + test-java-container: + runs-on: ${{ matrix.host.RUNNER }} + needs: [get-containers] + timeout-minutes: 25 strategy: - # Run all jobs fail-fast: false matrix: - java: - # - 11 - - 17 - runs-on: ubuntu-latest - container: amazonlinux:latest - timeout-minutes: 35 + java: ${{ fromJson(needs.get-containers.outputs.version-matrix-output) }} + engine: ${{ fromJson(needs.get-containers.outputs.engine-matrix-output) }} + host: ${{ fromJson(needs.get-containers.outputs.host-matrix-output) }} + container: + image: ${{ matrix.host.IMAGE }} + options: ${{ join(' -q ', matrix.host.CONTAINER_OPTIONS) }} # adding `-q` to bypass empty options steps: - name: Install git run: | - yum -y remove git - yum -y remove git-* - yum -y install https://packages.endpointdev.com/rhel/7/os/x86_64/endpoint-repo.x86_64.rpm yum update - yum install -y git - git --version - + yum install -y git tar java-${{ matrix.java }}-amazon-corretto-devel.x86_64 + echo IMAGE=amazonlinux:latest | sed -r 's/:/-/g' >> $GITHUB_ENV + # Replace `:` in the variable otherwise it can't be used in `upload-artifact` - uses: actions/checkout@v4 - - - name: Checkout submodules - run: | - git config --global --add safe.directory "$GITHUB_WORKSPACE" - git submodule update --init --recursive + with: + submodules: recursive - name: Install shared software dependencies uses: ./.github/workflows/install-shared-dependencies with: - os: "amazon-linux" - target: "x86_64-unknown-linux-gnu" + os: ${{ matrix.host.OS }} + target: ${{ matrix.host.TARGET }} github-token: ${{ secrets.GITHUB_TOKEN }} - engine-version: "7.2.5" + engine-version: ${{ matrix.engine.version }} - name: Install protoc (protobuf) uses: arduino/setup-protoc@v3 @@ -166,10 +188,6 @@ jobs: version: "26.1" repo-token: ${{ secrets.GITHUB_TOKEN }} - - name: Install Java - run: | - yum install -y java-${{ matrix.java }}-amazon-corretto-devel.x86_64 - - name: Build java wrapper working-directory: java run: ./gradlew --continue build -x javadoc @@ -179,7 +197,7 @@ jobs: continue-on-error: true uses: actions/upload-artifact@v4 with: - name: test-reports-${{ matrix.java }}-amazon-linux + name: test-reports-java-${{ matrix.java }}-${{ matrix.engine.type }}-${{ matrix.engine.version }}-${{ env.IMAGE }}-${{ matrix.host.ARCH }} path: | java/client/build/reports/** java/integTest/build/reports/** @@ -190,17 +208,19 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - + with: + submodules: recursive - uses: ./.github/workflows/lint-rust with: - cargo-toml-folder: ./java + cargo-toml-folder: java + github-token: ${{ secrets.GITHUB_TOKEN }} name: lint java rust test-modules: if: (github.repository_owner == 'valkey-io' && github.event_name == 'workflow_dispatch') || github.event.pull_request.head.repo.owner.login == 'valkey-io' environment: AWS_ACTIONS - name: Modules Tests + name: Running Module Tests runs-on: [self-hosted, linux, ARM64] timeout-minutes: 15 steps: @@ -208,7 +228,8 @@ jobs: run: sudo chown -R $USER:$USER /home/ubuntu/actions-runner/_work/valkey-glide - uses: actions/checkout@v4 - + with: + submodules: recursive - name: Set up JDK uses: actions/setup-java@v4 diff --git a/.github/workflows/lint-rust/action.yml b/.github/workflows/lint-rust/action.yml index 06b0b7a75a..aa8c433660 100644 --- a/.github/workflows/lint-rust/action.yml +++ b/.github/workflows/lint-rust/action.yml @@ -12,10 +12,10 @@ inputs: runs: using: "composite" - steps: - uses: actions/checkout@v4 - + with: + submodules: recursive - name: Install Rust toolchain and protoc uses: ./.github/workflows/install-rust-and-protoc @@ -35,11 +35,11 @@ runs: # We run clippy without features - run: cargo clippy --all-targets -- -D warnings working-directory: ${{ inputs.cargo-toml-folder }} - shell: bash + shell: bash - run: | cargo update - cargo install --locked cargo-deny + cargo install --locked --version 0.15.1 cargo-deny cargo deny check --config ${GITHUB_WORKSPACE}/deny.toml working-directory: ${{ inputs.cargo-toml-folder }} shell: bash diff --git a/.github/workflows/lint-ts/action.yml b/.github/workflows/lint-ts/action.yml index 834e3d7ec9..2f4b47e358 100644 --- a/.github/workflows/lint-ts/action.yml +++ b/.github/workflows/lint-ts/action.yml @@ -12,7 +12,7 @@ runs: steps: - uses: actions/checkout@v4 - - run: cp eslint.config.mjs ${{ inputs.package-folder }} + - run: cp eslint.config.mjs ${{ inputs.package-folder }} shell: bash - run: | diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml new file mode 100644 index 0000000000..06f5065e24 --- /dev/null +++ b/.github/workflows/nightly.yml @@ -0,0 +1,88 @@ +name: Nightly tests + +on: + workflow_dispatch: # note: if started manually, it won't run all matrix + inputs: + full-matrix: + description: "Run the full engine and host matrix" + type: boolean + default: false + # GHA supports up to 10 inputs, there is no option for multi-choice + core: + description: "Test GLIDE core" + type: boolean + default: true + node: + description: "Test Node client" + type: boolean + default: true + python: + description: "Test Python client" + type: boolean + default: true + java: + description: "Test Java client" + type: boolean + default: true + csharp: + description: "Test C# client" + type: boolean + default: false + go: + description: "Test Golang client" + type: boolean + default: false + + schedule: # running tests by cron is disabled on forks by the condition defined for each job + - cron: "0 3 * * *" # Runs at 03:00 (3 AM) UTC every day + +concurrency: + 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-input: + runs-on: ubuntu-latest + steps: + - 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: + 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-java: + 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 + secrets: inherit + + run-full-tests-for-python: + 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 + secrets: inherit + + run-full-tests-for-node: + 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 + secrets: inherit + + run-full-tests-for-csharp: + # 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 + secrets: inherit + + run-full-tests-for-go: + 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 + secrets: inherit diff --git a/.github/workflows/node-create-package-file/action.yml b/.github/workflows/node-create-package-file/action.yml index 1da7510aab..8c9cc9d2f2 100644 --- a/.github/workflows/node-create-package-file/action.yml +++ b/.github/workflows/node-create-package-file/action.yml @@ -84,4 +84,4 @@ runs: mv package.json package.json.tmpl envsubst < package.json.tmpl > "package.json" cat package.json - echo $(ls *json*) + echo $(ls *json*) diff --git a/.github/workflows/node.yml b/.github/workflows/node.yml index 1927649247..ef5c117a8e 100644 --- a/.github/workflows/node.yml +++ b/.github/workflows/node.yml @@ -8,7 +8,7 @@ on: - v* paths: - glide-core/src/** - - glide-core/redis-rs/redis/src/** + - submodules/** - node/** - utils/cluster_manager.py - .github/workflows/node.yml @@ -16,13 +16,13 @@ on: - .github/workflows/install-shared-dependencies/action.yml - .github/workflows/test-benchmark/action.yml - .github/workflows/lint-rust/action.yml - - .github/workflows/install-valkey/action.yml - - .github/json_matrices/build-matrix.json - - .github/workflows/start-self-hosted-runner/action.yml + - .github/workflows/install-engine/action.yml + - .github/json_matrices/** + - .github/workflows/create-test-matrices/action.yml pull_request: paths: - glide-core/src/** - - glide-core/redis-rs/redis/src/** + - submodules/** - node/** - utils/cluster_manager.py - .github/workflows/node.yml @@ -30,55 +30,78 @@ on: - .github/workflows/install-shared-dependencies/action.yml - .github/workflows/test-benchmark/action.yml - .github/workflows/lint-rust/action.yml - - .github/workflows/install-valkey/action.yml - - .github/json_matrices/build-matrix.json - - .github/workflows/start-self-hosted-runner/action.yml + - .github/workflows/install-engine/action.yml + - .github/json_matrices/** + - .github/workflows/create-test-matrices/action.yml workflow_dispatch: + inputs: + full-matrix: + description: "Run the full engine, host, and language version matrix" + type: boolean + default: false + name: + required: false + type: string + description: "(Optional) Test run name" + + workflow_call: concurrency: - group: node-${{ github.head_ref || github.ref }} + group: node-${{ github.head_ref || github.ref }}-${{ toJson(inputs) }} cancel-in-progress: true env: CARGO_TERM_COLOR: always +run-name: + # Set custom name if job is started manually and name is given + ${{ github.event_name == 'workflow_dispatch' && (inputs.name == '' && format('{0} @ {1} {2}', github.ref_name, github.sha, toJson(inputs)) || inputs.name) || '' }} + jobs: - load-engine-matrix: + get-matrices: runs-on: ubuntu-latest outputs: - matrix: ${{ steps.load-engine-matrix.outputs.matrix }} - steps: - - name: Checkout - uses: actions/checkout@v4 + engine-matrix-output: ${{ steps.get-matrices.outputs.engine-matrix-output }} + host-matrix-output: ${{ steps.get-matrices.outputs.host-matrix-output }} + version-matrix-output: ${{ steps.get-matrices.outputs.version-matrix-output }} - - name: Load the engine matrix - id: load-engine-matrix - shell: bash - run: echo "matrix=$(jq -c . < .github/json_matrices/engine-matrix.json)" >> $GITHUB_OUTPUT + steps: + - uses: actions/checkout@v4 + - id: get-matrices + uses: ./.github/workflows/create-test-matrices + with: + language-name: node + run-full-matrix: ${{ github.event.inputs.full-matrix == 'true' || github.event_name == 'schedule' }} - test-ubuntu-latest: - runs-on: ubuntu-latest - needs: load-engine-matrix + test-node: + runs-on: ${{ matrix.host.RUNNER }} + needs: [get-matrices] timeout-minutes: 25 strategy: fail-fast: false matrix: - engine: ${{ fromJson(needs.load-engine-matrix.outputs.matrix) }} - + engine: ${{ fromJson(needs.get-matrices.outputs.engine-matrix-output) }} + host: ${{ fromJson(needs.get-matrices.outputs.host-matrix-output) }} + node: ${{ fromJson(needs.get-matrices.outputs.version-matrix-output) }} steps: - uses: actions/checkout@v4 - + with: + submodules: recursive - - name: Use Node.js 16.x + - name: Setup Node uses: actions/setup-node@v4 + env: + ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true with: - node-version: 16.x + node-version: ${{ matrix.node }} - name: Build Node wrapper uses: ./.github/workflows/build-node-wrapper with: - os: "ubuntu" - target: "x86_64-unknown-linux-gnu" + os: ${{ matrix.host.OS }} + named_os: ${{ matrix.host.NAMED_OS }} + arch: ${{ matrix.host.ARCH }} + target: ${{ matrix.host.TARGET }} github-token: ${{ secrets.GITHUB_TOKEN }} engine-version: ${{ matrix.engine.version }} @@ -88,18 +111,16 @@ jobs: - name: test hybrid node modules - commonjs run: | - npm install --package-lock-only - npm ci - npm run build-and-test + npm install + npm run test working-directory: ./node/hybrid-node-tests/commonjs-test env: JEST_HTML_REPORTER_OUTPUT_PATH: test-report-commonjs.html - name: test hybrid node modules - ecma run: | - npm install --package-lock-only - npm ci - npm run build-and-test + npm install + npm run test working-directory: ./node/hybrid-node-tests/ecmascript-test env: JEST_HTML_REPORTER_OUTPUT_PATH: test-report-ecma.html @@ -113,7 +134,7 @@ jobs: continue-on-error: true uses: actions/upload-artifact@v4 with: - name: test-report-node-${{ matrix.engine.type }}-${{ matrix.engine.version }}-ubuntu + name: test-report-node-${{ matrix.node }}-${{ matrix.engine.type }}-${{ matrix.engine.version }}-${{ matrix.host.OS }}-${{ matrix.host.ARCH }} path: | node/test-report*.html utils/clusters/** @@ -124,142 +145,88 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - + with: + submodules: recursive - - name: lint node rust - uses: ./.github/workflows/lint-rust + - uses: ./.github/workflows/lint-rust with: cargo-toml-folder: ./node/rust-client github-token: ${{ secrets.GITHUB_TOKEN }} + name: lint node rust - # build-macos-latest: - # runs-on: macos-latest - # timeout-minutes: 25 - # steps: - # - uses: actions/checkout@v4 - # with: - # submodules: recursive - # - name: Set up Homebrew - # uses: Homebrew/actions/setup-homebrew@master - - # - name: Install NodeJS - # run: | - # brew update - # brew upgrade || true - # brew install node - - # - name: Downgrade npm major version to 8 - # run: | - # npm i -g npm@8 - - # - name: Build Node wrapper - # uses: ./.github/workflows/build-node-wrapper - # with: - # os: "macos" - # named_os: "darwin" - # arch: "arm64" - # target: "aarch64-apple-darwin" - # github-token: ${{ secrets.GITHUB_TOKEN }} - # engine-version: "7.2.5" - - # - name: Test compatibility - # run: npm test -- -t "set and get flow works" - # working-directory: ./node - - # - name: Upload test reports - # if: always() - # continue-on-error: true - # uses: actions/upload-artifact@v4 - # with: - # name: test-report-node-${{ matrix.engine.type }}-${{ matrix.engine.version }}-macos - # path: | - # node/test-report*.html - # utils/clusters/** - # benchmarks/results/** - - build-amazonlinux-latest: + get-containers: runs-on: ubuntu-latest - container: amazonlinux:latest - timeout-minutes: 15 - steps: - - name: Install git - run: | - yum -y remove git - yum -y remove git-* - yum -y install https://packages.endpointdev.com/rhel/7/os/x86_64/endpoint-repo.x86_64.rpm - yum install -y git - git --version + if: ${{ github.event.inputs.full-matrix == 'true' || github.event_name == 'schedule' }} + outputs: + engine-matrix-output: ${{ steps.get-matrices.outputs.engine-matrix-output }} + host-matrix-output: ${{ steps.get-matrices.outputs.host-matrix-output }} + version-matrix-output: ${{ steps.get-matrices.outputs.version-matrix-output }} + steps: - uses: actions/checkout@v4 - - - name: Checkout submodules - run: | - git config --global --add safe.directory "$GITHUB_WORKSPACE" - git submodule update --init --recursive - - - name: Install NodeJS - run: | - yum install -y nodejs - - - name: Build Node wrapper - uses: ./.github/workflows/build-node-wrapper - with: - os: "amazon-linux" - target: "x86_64-unknown-linux-gnu" - github-token: ${{ secrets.GITHUB_TOKEN }} - engine-version: "7.2.5" - - - name: Test compatibility - run: npm test -- -t "set and get flow works" - working-directory: ./node - - - name: Upload test reports - if: always() - continue-on-error: true - uses: actions/upload-artifact@v4 + - id: get-matrices + uses: ./.github/workflows/create-test-matrices with: - name: test-report-node-amazonlinux - path: | - node/test-report*.html - utils/clusters/** - benchmarks/results/** + language-name: node + run-full-matrix: true + containers: true - build-and-test-linux-musl-on-x86: - name: Build and test Node wrapper on Linux musl - runs-on: ubuntu-latest + test-node-container: + runs-on: ${{ matrix.host.RUNNER }} + needs: [get-containers] + timeout-minutes: 25 + strategy: + fail-fast: false + matrix: + node: ${{ fromJson(needs.get-containers.outputs.version-matrix-output) }} + engine: ${{ fromJson(needs.get-containers.outputs.engine-matrix-output) }} + host: ${{ fromJson(needs.get-containers.outputs.host-matrix-output) }} container: - image: node:alpine - options: --user root --privileged - + image: ${{ matrix.host.IMAGE }} + options: ${{ join(' -q ', matrix.host.CONTAINER_OPTIONS) }} # adding `-q` to bypass empty options steps: - name: Install git run: | - apk update - apk add git - + if [[ ${{ contains(matrix.host.TARGET, 'musl') }} == true ]]; then + apk update + apk add --no-cache git tar + elif [[ ${{ contains(matrix.host.IMAGE, 'amazonlinux') }} == true ]]; then + yum update + yum install -y git tar + fi + echo IMAGE=amazonlinux:latest | sed -r 's/:/-/g' >> $GITHUB_ENV + # Replace `:` in the variable otherwise it can't be used in `upload-artifact` - uses: actions/checkout@v4 - + with: + submodules: recursive - name: Setup musl on Linux + if: ${{ contains(matrix.host.TARGET, 'musl') }} uses: ./.github/workflows/setup-musl-on-linux with: workspace: $GITHUB_WORKSPACE npm-scope: ${{ secrets.NPM_SCOPE }} npm-auth-token: ${{ secrets.NPM_AUTH_TOKEN }} + - name: Setup Node + uses: actions/setup-node@v4 + env: + ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true + with: + node-version: ${{ matrix.node }} + - name: Build Node wrapper uses: ./.github/workflows/build-node-wrapper with: - os: ubuntu - named_os: linux - arch: x64 - target: x86_64-unknown-linux-musl + os: ${{ matrix.host.OS }} + named_os: ${{ matrix.host.NAMED_OS }} + target: ${{ matrix.host.TARGET }} github-token: ${{ secrets.GITHUB_TOKEN }} - engine-version: "7.2.5" + engine-version: ${{ matrix.engine.version }} + arch: ${{ matrix.host.ARCH }} - - name: Test compatibility - shell: bash - run: npm test -- -t "set and get flow works" + - name: test + run: npm test working-directory: ./node - name: Upload test reports @@ -267,7 +234,7 @@ jobs: continue-on-error: true uses: actions/upload-artifact@v4 with: - name: test-report-node-linux-musl + name: test-report-node-${{ matrix.node }}-${{ matrix.engine.type }}-${{ matrix.engine.version }}-${{ env.IMAGE }}-${{ matrix.host.ARCH }} path: | node/test-report*.html utils/clusters/** diff --git a/.github/workflows/npm-cd.yml b/.github/workflows/npm-cd.yml index 362117affb..4e58dc4c81 100644 --- a/.github/workflows/npm-cd.yml +++ b/.github/workflows/npm-cd.yml @@ -4,29 +4,30 @@ name: NPM - Continuous Deployment on: pull_request: - paths: - - .github/workflows/npm-cd.yml - - .github/workflows/build-node-wrapper/action.yml - - .github/workflows/start-self-hosted-runner/action.yml - - .github/workflows/install-rust-and-protoc/action.yml - - .github/workflows/install-shared-dependencies/action.yml - - .github/workflows/install-valkey/action.yml - - .github/json_matrices/build-matrix.json + paths: + - .github/workflows/npm-cd.yml + - .github/workflows/build-node-wrapper/action.yml + - .github/workflows/start-self-hosted-runner/action.yml + - .github/workflows/install-rust-and-protoc/action.yml + - .github/workflows/install-shared-dependencies/action.yml + - .github/workflows/install-engine/action.yml + - .github/json_matrices/** + - .github/workflows/create-test-matrices/action.yml push: tags: - "v*.*" workflow_dispatch: - inputs: - version: - description: 'The release version of GLIDE, formatted as *.*.* or *.*.*-rc*' - required: true + inputs: + version: + description: "The release version of GLIDE, formatted as *.*.* or *.*.*-rc*" + required: true concurrency: - group: npm-${{ github.head_ref || github.ref }} + group: node-cd-${{ github.head_ref || github.ref }}-${{ toJson(inputs) }} cancel-in-progress: true permissions: - id-token: write + id-token: write jobs: start-self-hosted-runner: @@ -34,17 +35,17 @@ jobs: runs-on: ubuntu-latest environment: AWS_ACTIONS steps: - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Start self hosted EC2 runner - uses: ./.github/workflows/start-self-hosted-runner - with: - role-to-assume: ${{ secrets.ROLE_TO_ASSUME }} - aws-region: ${{ secrets.AWS_REGION }} - ec2-instance-id: ${{ secrets.AWS_EC2_INSTANCE_ID }} + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Start self hosted EC2 runner + uses: ./.github/workflows/start-self-hosted-runner + with: + role-to-assume: ${{ secrets.ROLE_TO_ASSUME }} + aws-region: ${{ secrets.AWS_REGION }} + ec2-instance-id: ${{ secrets.AWS_EC2_INSTANCE_ID }} load-platform-matrix: runs-on: ubuntu-latest @@ -58,9 +59,9 @@ jobs: id: load-platform-matrix shell: bash run: | - # Get the matrix from the matrix.json file, without the object that has the IMAGE key - export "PLATFORM_MATRIX=$(jq 'map(select(.PACKAGE_MANAGERS | contains(["npm"])))' < .github/json_matrices/build-matrix.json | jq -c .)" - echo "PLATFORM_MATRIX=${PLATFORM_MATRIX}" >> $GITHUB_OUTPUT + # Get the matrix from the matrix.json file, without the object that has the IMAGE key + export "PLATFORM_MATRIX=$(jq 'map(select(.PACKAGE_MANAGERS != null and (.PACKAGE_MANAGERS | contains(["npm"]))))' < .github/json_matrices/build-matrix.json | jq -c .)" + echo "PLATFORM_MATRIX=${PLATFORM_MATRIX}" >> $GITHUB_OUTPUT publish-binaries: needs: [start-self-hosted-runner, load-platform-matrix] @@ -73,7 +74,7 @@ jobs: strategy: fail-fast: false matrix: - build: ${{fromJson(needs.load-platform-matrix.outputs.PLATFORM_MATRIX)}} + build: ${{fromJson(needs.load-platform-matrix.outputs.PLATFORM_MATRIX)}} steps: - name: Setup self-hosted runner access if: ${{ contains(matrix.build.RUNNER, 'self-hosted') && matrix.build.TARGET != 'aarch64-unknown-linux-musl' }} @@ -85,7 +86,7 @@ jobs: run: | apk update apk add git - + - name: Checkout if: ${{ matrix.build.TARGET != 'aarch64-unknown-linux-musl' }} uses: actions/checkout@v4 @@ -100,7 +101,7 @@ jobs: workspace: $GITHUB_WORKSPACE npm-scope: ${{ vars.NPM_SCOPE }} npm-auth-token: ${{ secrets.NPM_AUTH_TOKEN }} - arch: ${{ matrix.build.ARCH }} + arch: ${{ matrix.build.ARCH }} - name: Set the release version shell: bash @@ -115,28 +116,28 @@ jobs: fi echo "RELEASE_VERSION=${R_VERSION}" >> $GITHUB_ENV env: - EVENT_NAME: ${{ github.event_name }} - INPUT_VERSION: ${{ github.event.inputs.version }} + EVENT_NAME: ${{ github.event_name }} + INPUT_VERSION: ${{ github.event.inputs.version }} - name: Setup node - if: ${{ !contains(matrix.build.TARGET, 'musl') }} - uses: actions/setup-node@v4 + if: ${{ matrix.build.TARGET != 'aarch64-unknown-linux-musl' }} + uses: actions/setup-node@v3 with: - node-version: "latest" + node-version: "20" registry-url: "https://registry.npmjs.org" architecture: ${{ matrix.build.ARCH }} scope: "${{ vars.NPM_SCOPE }}" always-auth: true token: ${{ secrets.NPM_AUTH_TOKEN }} - + - name: Setup node for publishing - if: ${{ !contains(matrix.build.TARGET, 'musl') }} + if: ${{ matrix.build.TARGET == 'aarch64-unknown-linux-musl' }} working-directory: ./node run: | - npm config set registry https://registry.npmjs.org/ - npm config set '//registry.npmjs.org/:_authToken' ${{ secrets.NPM_AUTH_TOKEN }} - npm config set scope ${{ vars.NPM_SCOPE }} - + npm config set registry https://registry.npmjs.org/ + npm config set '//registry.npmjs.org/:_authToken' ${{ secrets.NPM_AUTH_TOKEN }} + npm config set scope ${{ vars.NPM_SCOPE }} + - name: Update package version in config.toml uses: ./.github/workflows/update-glide-version with: @@ -153,8 +154,7 @@ jobs: npm_scope: ${{ vars.NPM_SCOPE }} publish: "true" github-token: ${{ secrets.GITHUB_TOKEN }} - engine-version: "7.2.5" - + - name: Check if RC and set a distribution tag for the package shell: bash run: | @@ -171,9 +171,9 @@ jobs: - name: Check that the release version dont have typo init if: ${{ github.event_name != 'pull_request' && contains(env.RELEASE_VERSION, '-') && !contains(env.RELEASE_VERSION, 'rc') }} run: | - echo "The release version "${GITHUB_REF:11}" contains a typo, please fix it" - echo "The release version should be in the format v{major-version}.{minor-version}.{patch-version}-rc{release-candidate-number} when it a release candidate or v{major-version}.{minor-version}.{patch-version} in a stable release." - exit 1 + echo "The release version "${GITHUB_REF:11}" contains a typo, please fix it" + echo "The release version should be in the format v{major-version}.{minor-version}.{patch-version}-rc{release-candidate-number} when it a release candidate or v{major-version}.{minor-version}.{patch-version} in a stable release." + exit 1 - name: Publish to NPM if: github.event_name != 'pull_request' @@ -203,11 +203,11 @@ jobs: if: ${{ matrix.build.ARCH == 'arm64' }} shell: bash run: | - echo "Resetting repository" - git clean -xdf - git reset --hard - git fetch - git checkout ${{ github.sha }} + echo "Resetting repository" + git clean -xdf + git reset --hard + git fetch + git checkout ${{ github.sha }} publish-base-to-npm: if: github.event_name != 'pull_request' @@ -260,8 +260,7 @@ jobs: os: ubuntu target: "x86_64-unknown-linux-gnu" github-token: ${{ secrets.GITHUB_TOKEN }} - engine-version: "7.2.5" - + - name: Check if RC and set a distribution tag for the package shell: bash run: | @@ -274,7 +273,7 @@ jobs: export npm_tag="latest" fi echo "NPM_TAG=${npm_tag}" >> $GITHUB_ENV - + - name: Publish the base package if: github.event_name != 'pull_request' shell: bash @@ -299,7 +298,7 @@ jobs: strategy: fail-fast: false matrix: - build: ${{fromJson(needs.load-platform-matrix.outputs.PLATFORM_MATRIX)}} + build: ${{fromJson(needs.load-platform-matrix.outputs.PLATFORM_MATRIX)}} steps: - name: Setup self-hosted runner access if: ${{ matrix.build.TARGET == 'aarch64-unknown-linux-gnu' }} @@ -308,20 +307,20 @@ jobs: - name: install Redis and git for alpine if: ${{ contains(matrix.build.TARGET, 'musl') }} run: | - apk update - apk add redis git - node -v - + apk update + apk add redis git + node -v + - name: install Redis and Python for ubuntu if: ${{ contains(matrix.build.TARGET, 'linux-gnu') }} run: | - sudo apt-get update - sudo apt-get install redis-server python3 + sudo apt-get update + sudo apt-get install redis-server python3 - name: install Redis, Python for macos if: ${{ contains(matrix.build.RUNNER, 'mac') }} run: | - brew install redis python3 + brew install redis python3 - name: Checkout if: ${{ matrix.build.TARGET != 'aarch64-unknown-linux-musl'}} @@ -384,5 +383,5 @@ jobs: if: ${{ contains(matrix.build.RUNNER, 'self-hosted') }} shell: bash run: | - git reset --hard - git clean -xdf + git reset --hard + git clean -xdf diff --git a/.github/workflows/ort.yml b/.github/workflows/ort.yml index fcea61ee6b..2eff2a3f1a 100644 --- a/.github/workflows/ort.yml +++ b/.github/workflows/ort.yml @@ -1,34 +1,33 @@ - name: The OSS Review Toolkit (ORT) on: schedule: - - cron: "0 0 * * *" + - cron: "0 0 * * *" pull_request: - paths: - - .github/workflows/ort.yml - - .github/workflows/run-ort-tools/action.yml - - utils/get_licenses_from_ort.py + paths: + - .github/workflows/ort.yml + - .github/workflows/run-ort-tools/action.yml + - utils/get_licenses_from_ort.py workflow_dispatch: - inputs: - branch: - description: 'The branch to run against the ORT tool' - required: true - version: - description: 'The release version of GLIDE' - required: true + inputs: + branch: + description: "The branch to run against the ORT tool" + required: true + version: + description: "The release version of GLIDE" + required: true jobs: run-ort: if: github.repository_owner == 'valkey-io' name: Create attribution files runs-on: ubuntu-latest strategy: - fail-fast: false - env: - PYTHON_ATTRIBUTIONS: "python/THIRD_PARTY_LICENSES_PYTHON" - NODE_ATTRIBUTIONS: "node/THIRD_PARTY_LICENSES_NODE" - RUST_ATTRIBUTIONS: "glide-core/THIRD_PARTY_LICENSES_RUST" - JAVA_ATTRIBUTIONS: "java/THIRD_PARTY_LICENSES_JAVA" + fail-fast: false + env: + PYTHON_ATTRIBUTIONS: "python/THIRD_PARTY_LICENSES_PYTHON" + NODE_ATTRIBUTIONS: "node/THIRD_PARTY_LICENSES_NODE" + RUST_ATTRIBUTIONS: "glide-core/THIRD_PARTY_LICENSES_RUST" + JAVA_ATTRIBUTIONS: "java/THIRD_PARTY_LICENSES_JAVA" steps: - name: Set the release version shell: bash @@ -36,17 +35,17 @@ jobs: export version=`if [ "$EVENT_NAME" == 'schedule' ] || [ "$EVENT_NAME" == 'pull_request' ]; then echo '255.255.255'; else echo "$INPUT_VERSION"; fi` echo "RELEASE_VERSION=${version}" >> $GITHUB_ENV env: - EVENT_NAME: ${{ github.event_name }} - INPUT_VERSION: ${{ github.event.inputs.version }} - + EVENT_NAME: ${{ github.event_name }} + INPUT_VERSION: ${{ github.event.inputs.version }} + - name: Set the base branch run: | - export BASE_BRANCH=`if [ "$EVENT_NAME" == 'schedule' ]; then echo 'main'; elif [ "$EVENT_NAME" == 'workflow_dispatch' ]; then echo "$INPUT_BRANCH"; else echo ""; fi` - echo "Base branch is: ${BASE_BRANCH}" - echo "BASE_BRANCH=${BASE_BRANCH}" >> $GITHUB_ENV + export BASE_BRANCH=`if [ "$EVENT_NAME" == 'schedule' ]; then echo 'main'; elif [ "$EVENT_NAME" == 'workflow_dispatch' ]; then echo "$INPUT_BRANCH"; else echo ""; fi` + echo "Base branch is: ${BASE_BRANCH}" + echo "BASE_BRANCH=${BASE_BRANCH}" >> $GITHUB_ENV env: - EVENT_NAME: ${{ github.event_name }} - INPUT_BRANCH: ${{ github.event.inputs.branch }} + EVENT_NAME: ${{ github.event_name }} + INPUT_BRANCH: ${{ github.event.inputs.branch }} - name: Checkout uses: actions/checkout@v4 @@ -64,73 +63,73 @@ jobs: uses: actions/cache@v4 id: cache-ort with: - path: | - ./ort - ~/.gradle/caches - ~/.gradle/wrapper - key: ${{ runner.os }}-ort + path: | + ./ort + ~/.gradle/caches + ~/.gradle/wrapper + key: ${{ runner.os }}-ort - name: Checkout ORT Repository if: steps.cache-ort.outputs.cache-hit != 'true' uses: actions/checkout@v4 - with: + with: repository: "oss-review-toolkit/ort" path: "./ort" ref: "26.0.0" submodules: recursive - name: Install Rust toolchain - uses: dtolnay/rust-toolchain@1.78 + uses: dtolnay/rust-toolchain@1.78 - name: Install ORT if: steps.cache-ort.outputs.cache-hit != 'true' working-directory: ./ort/ run: | - export JAVA_OPTS="$JAVA_OPTS -Xmx8g" - ./gradlew installDist + export JAVA_OPTS="$JAVA_OPTS -Xmx8g" + ./gradlew installDist - name: Create ORT config file run: | - mkdir -p ~/.ort/config - cat << EOF > ~/.ort/config/config.yml - ort: - analyzer: - allowDynamicVersions: true - enabledPackageManagers: [Cargo, NPM, PIP, GradleInspector] - EOF - cat ~/.ort/config/config.yml + mkdir -p ~/.ort/config + cat << EOF > ~/.ort/config/config.yml + ort: + analyzer: + allowDynamicVersions: true + enabledPackageManagers: [Cargo, NPM, PIP, GradleInspector] + EOF + cat ~/.ort/config/config.yml - ### NodeJS ### + ### NodeJS ### - name: Set up Node.js 16.x uses: actions/setup-node@v4 with: node-version: 16.x - - name: Create package.json file for the Node wrapper + - name: Create package.json file for the Node wrapper uses: ./.github/workflows/node-create-package-file with: - release_version: ${{ env.RELEASE_VERSION }} - os: "ubuntu-latest" + release_version: ${{ env.RELEASE_VERSION }} + os: "ubuntu-latest" - name: Fix Node base NPM package.json file for ORT working-directory: ./node/npm/glide run: | - # Remove the glide-rs dependency to avoid duplication - sed -i '/ "glide-rs":/d' ../../package.json - export pkg_name=valkey-glide-base - export package_version="${{ env.RELEASE_VERSION }}" - export scope=`if [ "$NPM_SCOPE" != '' ]; then echo "$NPM_SCOPE/"; fi` - mv package.json package.json.tmpl - envsubst < package.json.tmpl > "package.json" - cat package.json - + # Remove the glide-rs dependency to avoid duplication + sed -i '/ "glide-rs":/d' ../../package.json + export pkg_name=valkey-glide-base + export package_version="${{ env.RELEASE_VERSION }}" + export scope=`if [ "$NPM_SCOPE" != '' ]; then echo "$NPM_SCOPE/"; fi` + mv package.json package.json.tmpl + envsubst < package.json.tmpl > "package.json" + cat package.json + - name: Run ORT tools for Node uses: ./.github/workflows/run-ort-tools with: - folder_path: "${{ github.workspace }}/node" - - ### Python ### + folder_path: "${{ github.workspace }}/node" + + ### Python ### - name: Set up Python 3.10 uses: actions/setup-python@v5 @@ -146,14 +145,14 @@ jobs: - name: Run ORT tools for Python uses: ./.github/workflows/run-ort-tools with: - folder_path: "${{ github.workspace }}/python" + folder_path: "${{ github.workspace }}/python" ### Rust ### - name: Run ORT tools for Rust uses: ./.github/workflows/run-ort-tools with: - folder_path: "${{ github.workspace }}/glide-core" + folder_path: "${{ github.workspace }}/glide-core" ### Java ### @@ -163,60 +162,60 @@ jobs: distribution: "temurin" java-version: 11 - - name: Run ORT tools for Java + - name: Run ORT tools for Java uses: ./.github/workflows/run-ort-tools with: - folder_path: "${{ github.workspace }}/java" + folder_path: "${{ github.workspace }}/java" ### Process results ### - name: Check for diff run: | - cp python/ort_results/NOTICE_DEFAULT $PYTHON_ATTRIBUTIONS - cp node/ort_results/NOTICE_DEFAULT $NODE_ATTRIBUTIONS - cp glide-core/ort_results/NOTICE_DEFAULT $RUST_ATTRIBUTIONS - cp java/ort_results/NOTICE_DEFAULT $JAVA_ATTRIBUTIONS - GIT_DIFF=`git diff $PYTHON_ATTRIBUTIONS $NODE_ATTRIBUTIONS $RUST_ATTRIBUTIONS $JAVA_ATTRIBUTIONS` - if [ -n "$GIT_DIFF" ]; then - echo "FOUND_DIFF=true" >> $GITHUB_ENV - else - echo "FOUND_DIFF=false" >> $GITHUB_ENV - fi + cp python/ort_results/NOTICE_DEFAULT $PYTHON_ATTRIBUTIONS + cp node/ort_results/NOTICE_DEFAULT $NODE_ATTRIBUTIONS + cp glide-core/ort_results/NOTICE_DEFAULT $RUST_ATTRIBUTIONS + cp java/ort_results/NOTICE_DEFAULT $JAVA_ATTRIBUTIONS + GIT_DIFF=`git diff $PYTHON_ATTRIBUTIONS $NODE_ATTRIBUTIONS $RUST_ATTRIBUTIONS $JAVA_ATTRIBUTIONS` + if [ -n "$GIT_DIFF" ]; then + echo "FOUND_DIFF=true" >> $GITHUB_ENV + else + echo "FOUND_DIFF=false" >> $GITHUB_ENV + fi - name: Retrieve licenses list working-directory: ./utils run: | - { - echo 'LICENSES_LIST<> "$GITHUB_ENV" + { + echo 'LICENSES_LIST<> "$GITHUB_ENV" ### Create PR ### - name: Create pull request if: ${{ env.FOUND_DIFF == 'true' && github.event_name != 'pull_request' }} run: | - export BRANCH_NAME=`if [ "$EVENT_NAME" == 'schedule' ] || [ "$EVENT_NAME" == 'pull_request' ]; then echo 'scheduled-ort'; else echo "ort-v$INPUT_VERSION"; fi` - echo "Creating pull request from branch ${BRANCH_NAME} to branch ${{ env.BASE_BRANCH }}" - git config --global user.email "valkey-glide@lists.valkey.io" - git config --global user.name "ort-bot" - git checkout -b ${BRANCH_NAME} - git add $PYTHON_ATTRIBUTIONS $NODE_ATTRIBUTIONS $RUST_ATTRIBUTIONS $JAVA_ATTRIBUTIONS - git commit -m "Updated attribution files" -s - git push --set-upstream origin ${BRANCH_NAME} -f - title="Updated attribution files for ${BRANCH_NAME}" - gh pr create -B ${{ env.BASE_BRANCH }} -H ${BRANCH_NAME} --title "${title}" --body 'Created by Github action.\n${{ env.LICENSES_LIST }}' + export BRANCH_NAME=`if [ "$EVENT_NAME" == 'schedule' ] || [ "$EVENT_NAME" == 'pull_request' ]; then echo 'scheduled-ort'; else echo "ort-v$INPUT_VERSION"; fi` + echo "Creating pull request from branch ${BRANCH_NAME} to branch ${{ env.BASE_BRANCH }}" + git config --global user.email "valkey-glide@lists.valkey.io" + git config --global user.name "ort-bot" + git checkout -b ${BRANCH_NAME} + git add $PYTHON_ATTRIBUTIONS $NODE_ATTRIBUTIONS $RUST_ATTRIBUTIONS $JAVA_ATTRIBUTIONS + git commit -m "Updated attribution files" -s + git push --set-upstream origin ${BRANCH_NAME} -f + title="Updated attribution files for ${BRANCH_NAME}" + gh pr create -B ${{ env.BASE_BRANCH }} -H ${BRANCH_NAME} --title "${title}" --body 'Created by Github action.\n${{ env.LICENSES_LIST }}' env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - EVENT_NAME: ${{ github.event_name }} - INPUT_VERSION: ${{ github.event.inputs.version }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + EVENT_NAME: ${{ github.event_name }} + INPUT_VERSION: ${{ github.event.inputs.version }} - name: Get current date id: date run: | - CURR_DATE=$(date +'%Y-%m-%d-%H') - echo "date=${CURR_DATE}" >> $GITHUB_OUTPUT + CURR_DATE=$(date +'%Y-%m-%d-%H') + echo "date=${CURR_DATE}" >> $GITHUB_OUTPUT - name: Upload the final package list continue-on-error: true diff --git a/.github/workflows/pypi-cd.yml b/.github/workflows/pypi-cd.yml index 5d547ac7f5..647dbd1c8e 100644 --- a/.github/workflows/pypi-cd.yml +++ b/.github/workflows/pypi-cd.yml @@ -9,8 +9,9 @@ on: - .github/workflows/build-python-wrapper/action.yml - .github/workflows/start-self-hosted-runner/action.yml - .github/workflows/install-shared-dependencies/action.yml - - .github/workflows/install-valkey/action.yml - - .github/json_matrices/build-matrix.json + - .github/workflows/install-engine/action.yml + - .github/json_matrices/** + - .github/workflows/create-test-matrices/action.yml push: tags: - "v*.*" @@ -41,7 +42,7 @@ jobs: shell: bash run: | # Get the matrix from the matrix.json file, without the object that has the IMAGE key - export "PLATFORM_MATRIX=$(jq 'map(select(.PACKAGE_MANAGERS | contains(["pypi"])))' < .github/json_matrices/build-matrix.json | jq -c .)" + export "PLATFORM_MATRIX=$(jq 'map(select(.PACKAGE_MANAGERS != null and (.PACKAGE_MANAGERS | contains(["pypi"]))))' < .github/json_matrices/build-matrix.json | jq -c .)" echo "PLATFORM_MATRIX=${PLATFORM_MATRIX}" >> $GITHUB_OUTPUT start-self-hosted-runner: @@ -114,13 +115,6 @@ jobs: with: python-version: "3.12" - - name: Setup Python for self-hosted Ubuntu runners - if: contains(matrix.build.RUNNER, 'self-hosted') - run: | - sudo apt update -y - sudo apt upgrade -y - sudo apt install python3 python3-venv python3-pip -y - - name: Update package version in config.toml uses: ./.github/workflows/update-glide-version with: @@ -134,7 +128,6 @@ jobs: target: ${{ matrix.build.TARGET }} publish: "true" github-token: ${{ secrets.GITHUB_TOKEN }} - engine-version: "7.2" - name: Include protobuf files in the package working-directory: ./python @@ -150,7 +143,7 @@ jobs: with: working-directory: ./python target: ${{ matrix.build.TARGET }} - args: --release --strip --out wheels -i ${{ github.event_name != 'pull_request' && 'python3.8 python3.9 python3.10 python3.11 python3.12' || 'python3.10' }} + args: --release --strip --out wheels -i ${{ github.event_name != 'pull_request' && 'python3.8 python3.9 python3.10 python3.11 python3.12 python3.13' || 'python3.12' }} manylinux: auto container: ${{ matrix.build.CONTAINER != '' && matrix.build.CONTAINER || '2014' }} before-script-linux: | @@ -178,9 +171,10 @@ jobs: if: startsWith(matrix.build.NAMED_OS, 'darwin') uses: PyO3/maturin-action@v1 with: + maturin-version: latest working-directory: ./python target: ${{ matrix.build.TARGET }} - args: --release --strip --out wheels -i ${{ github.event_name != 'pull_request' && 'python3.8 python3.9 python3.10 python3.11 python3.12' || 'python3.12' }} + args: --release --strip --out wheels -i ${{ github.event_name != 'pull_request' && 'python3.8 python3.9 python3.10 python3.11 python3.12 python3.13' || 'python3.12' }} - name: Upload Python wheels if: github.event_name != 'pull_request' @@ -220,10 +214,6 @@ jobs: matrix: build: ${{ fromJson(needs.load-platform-matrix.outputs.PLATFORM_MATRIX) }} steps: - - name: Setup self-hosted runner access - if: ${{ matrix.build.TARGET == 'aarch64-unknown-linux-gnu' }} - run: sudo chown -R $USER:$USER /home/ubuntu/actions-runner/_work/valkey-glide - - name: checkout uses: actions/checkout@v4 @@ -232,8 +222,8 @@ jobs: with: python-version: 3.12 - - name: Install ValKey - uses: ./.github/workflows/install-valkey + - name: Install engine + uses: ./.github/workflows/install-engine with: version: "8.0" diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index 6c45d7707c..3fcd171498 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -9,85 +9,93 @@ on: paths: - python/** - glide-core/src/** - - glide-core/redis-rs/redis/src/**/** + - submodules/** - utils/cluster_manager.py - .github/workflows/python.yml - .github/workflows/build-python-wrapper/action.yml - .github/workflows/install-shared-dependencies/action.yml - .github/workflows/test-benchmark/action.yml - .github/workflows/lint-rust/action.yml - - .github/workflows/install-valkey/action.yml - - .github/json_matrices/build-matrix.json - - .github/json_matrices/engine-matrix.json + - .github/workflows/install-engine/action.yml - .github/workflows/start-self-hosted-runner/action.yml + - .github/workflows/create-test-matrices/action.yml + - .github/json_matrices/** pull_request: paths: - python/** - glide-core/src/** - - glide-core/redis-rs/redis/src/** + - submodules/** - utils/cluster_manager.py - .github/workflows/python.yml - .github/workflows/build-python-wrapper/action.yml - .github/workflows/install-shared-dependencies/action.yml - .github/workflows/test-benchmark/action.yml - .github/workflows/lint-rust/action.yml - - .github/workflows/install-valkey/action.yml - - .github/json_matrices/build-matrix.json - - .github/json_matrices/engine-matrix.json + - .github/workflows/install-engine/action.yml - .github/workflows/start-self-hosted-runner/action.yml + - .github/workflows/create-test-matrices/action.yml + - .github/json_matrices/** + workflow_dispatch: + inputs: + full-matrix: + description: "Run the full engine, host, and language version matrix" + type: boolean + default: false + name: + required: false + type: string + description: "(Optional) Test run name" + + workflow_call: concurrency: - group: python-${{ github.head_ref || github.ref }} + group: python-${{ github.head_ref || github.ref }}-${{ toJson(inputs) }} cancel-in-progress: true +permissions: + contents: read + # Allows the GITHUB_TOKEN to make an API call to generate an OIDC token. + id-token: write + +run-name: + # Set custom name if job is started manually and name is given + ${{ github.event_name == 'workflow_dispatch' && (inputs.name == '' && format('{0} @ {1} {2}', github.ref_name, github.sha, toJson(inputs)) || inputs.name) || '' }} + jobs: - load-engine-matrix: + get-matrices: runs-on: ubuntu-latest outputs: - matrix: ${{ steps.load-engine-matrix.outputs.matrix }} + engine-matrix-output: ${{ steps.get-matrices.outputs.engine-matrix-output }} + host-matrix-output: ${{ steps.get-matrices.outputs.host-matrix-output }} + version-matrix-output: ${{ steps.get-matrices.outputs.version-matrix-output }} steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Load the engine matrix - id: load-engine-matrix - shell: bash - run: echo "matrix=$(jq -c . < .github/json_matrices/engine-matrix.json)" >> $GITHUB_OUTPUT - - test: + - uses: actions/checkout@v4 + - id: get-matrices + uses: ./.github/workflows/create-test-matrices + with: + language-name: python + # Run full test matrix if job started by cron or it was explictly specified by a person who triggered the workflow + run-full-matrix: ${{ github.event.inputs.full-matrix == 'true' || github.event_name == 'schedule' }} + + test-python: runs-on: ${{ matrix.host.RUNNER }} - needs: load-engine-matrix + needs: get-matrices timeout-minutes: 35 strategy: fail-fast: false matrix: - engine: ${{ fromJson(needs.load-engine-matrix.outputs.matrix) }} - python: - # - "3.8" - # - "3.9" - # - "3.10" - # - "3.11" - - "3.12" - host: - - { - OS: ubuntu, - RUNNER: ubuntu-latest, - TARGET: x86_64-unknown-linux-gnu - } - # - { - # OS: macos, - # RUNNER: macos-latest, - # TARGET: aarch64-apple-darwin - # } - + python: ${{ fromJson(needs.get-matrices.outputs.version-matrix-output) }} + engine: ${{ fromJson(needs.get-matrices.outputs.engine-matrix-output) }} + host: ${{ fromJson(needs.get-matrices.outputs.host-matrix-output) }} steps: - uses: actions/checkout@v4 - + with: + submodules: recursive - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python }} @@ -138,41 +146,27 @@ jobs: utils/clusters/** benchmarks/results/** - test-pubsub: + # run pubsub tests in another job - they take too much time + test-pubsub-python: runs-on: ${{ matrix.host.RUNNER }} - needs: load-engine-matrix + needs: get-matrices timeout-minutes: 35 strategy: fail-fast: false matrix: - engine: ${{ fromJson(needs.load-engine-matrix.outputs.matrix) }} - python: - # - "3.8" - # - "3.9" - # - "3.10" - # - "3.11" - - "3.12" - host: - - { - OS: ubuntu, - RUNNER: ubuntu-latest, - TARGET: x86_64-unknown-linux-gnu - } - # - { - # OS: macos, - # RUNNER: macos-latest, - # TARGET: aarch64-apple-darwin - # } - + python: ${{ fromJson(needs.get-matrices.outputs.version-matrix-output) }} + engine: ${{ fromJson(needs.get-matrices.outputs.engine-matrix-output) }} + host: ${{ fromJson(needs.get-matrices.outputs.host-matrix-output) }} steps: - uses: actions/checkout@v4 - - + with: + submodules: recursive + - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python }} - + - name: Build Python wrapper uses: ./.github/workflows/build-python-wrapper with: @@ -180,14 +174,14 @@ jobs: target: ${{ matrix.host.TARGET }} github-token: ${{ secrets.GITHUB_TOKEN }} engine-version: ${{ matrix.engine.version }} - + - name: Test pubsub with pytest working-directory: ./python run: | source .env/bin/activate cd python/tests/ pytest --asyncio-mode=auto -k test_pubsub --html=pytest_report.html --self-contained-html - + - name: Upload test reports if: always() continue-on-error: true @@ -202,12 +196,14 @@ jobs: timeout-minutes: 15 steps: - uses: actions/checkout@v4 - + with: + submodules: recursive - name: lint rust uses: ./.github/workflows/lint-rust with: - cargo-toml-folder: ./python + cargo-toml-folder: python + github-token: ${{ secrets.GITHUB_TOKEN }} - name: Install dependencies if: always() @@ -236,66 +232,92 @@ jobs: run: | black --check --diff . - build-amazonlinux-latest: + get-containers: runs-on: ubuntu-latest - container: amazonlinux:latest - timeout-minutes: 15 - steps: - - name: Install git - run: | - yum -y remove git - yum -y remove git-* - yum -y install https://packages.endpointdev.com/rhel/7/os/x86_64/endpoint-repo.x86_64.rpm - yum install -y git - git --version + if: ${{ github.event.inputs.full-matrix == 'true' || github.event_name == 'schedule' }} + outputs: + engine-matrix-output: ${{ steps.get-matrices.outputs.engine-matrix-output }} + host-matrix-output: ${{ steps.get-matrices.outputs.host-matrix-output }} + version-matrix-output: ${{ steps.get-matrices.outputs.version-matrix-output }} + steps: - uses: actions/checkout@v4 + - id: get-matrices + uses: ./.github/workflows/create-test-matrices + with: + language-name: python + run-full-matrix: true + containers: true - - name: Checkout submodules - run: | - git config --global --add safe.directory "$GITHUB_WORKSPACE" - git submodule update --init --recursive - - - name: Install python + test-python-container: + runs-on: ${{ matrix.host.RUNNER }} + needs: [get-containers] + timeout-minutes: 25 + strategy: + fail-fast: false + matrix: + # Don't use generated matrix for python until compatibility issues resolved on amazon linux + # python: ${{ fromJson(needs.get-containers.outputs.version-matrix-output) }} + engine: ${{ fromJson(needs.get-containers.outputs.engine-matrix-output) }} + host: ${{ fromJson(needs.get-containers.outputs.host-matrix-output) }} + container: + image: ${{ matrix.host.IMAGE }} + options: ${{ join(' -q ', matrix.host.CONTAINER_OPTIONS) }} # adding `-q` to bypass empty options + steps: + - name: Install git and python run: | - yum install -y python3 + yum update + yum install -y git tar python3 + python3 -m ensurepip --upgrade + python3 -m pip install --upgrade pip + python3 -m pip install mypy-protobuf virtualenv + echo IMAGE=amazonlinux:latest | sed -r 's/:/-/g' >> $GITHUB_ENV + # Replace `:` in the variable otherwise it can't be used in `upload-artifact` + - uses: actions/checkout@v4 + with: + submodules: recursive - name: Build Python wrapper uses: ./.github/workflows/build-python-wrapper with: - os: "amazon-linux" - target: "x86_64-unknown-linux-gnu" + os: ${{ matrix.host.OS }} + target: ${{ matrix.host.TARGET }} github-token: ${{ secrets.GITHUB_TOKEN }} - engine-version: "7.2.5" + engine-version: ${{ matrix.engine.version }} - - name: Test compatibility with pytest + - name: Test with pytest working-directory: ./python run: | source .env/bin/activate - pytest --asyncio-mode=auto -m smoke_test --html=pytest_report.html --self-contained-html + cd python/tests/ + pytest --asyncio-mode=auto --html=pytest_report.html --self-contained-html - name: Upload test reports if: always() continue-on-error: true uses: actions/upload-artifact@v4 with: - name: smoke-test-report-amazon-linux + name: test-report-python-${{ matrix.python }}-${{ matrix.engine.type }}-${{ matrix.engine.version }}-${{ env.IMAGE }}-${{ matrix.host.ARCH }} path: | python/python/tests/pytest_report.html - + utils/clusters/** + benchmarks/results/** + test-modules: if: (github.repository_owner == 'valkey-io' && github.event_name == 'workflow_dispatch') || github.event.pull_request.head.repo.owner.login == 'valkey-io' environment: AWS_ACTIONS name: Running Module Tests runs-on: [self-hosted, linux, ARM64] timeout-minutes: 15 - + steps: - name: Setup self-hosted runner access if: ${{ contains(matrix.host.RUNNER, 'self-hosted') }} run: sudo chown -R $USER:$USER /home/ubuntu/actions-runner/_work/valkey-glide - uses: actions/checkout@v4 + with: + submodules: recursive - name: Build Python wrapper uses: ./.github/workflows/build-python-wrapper @@ -303,7 +325,6 @@ jobs: os: ubuntu target: aarch64-unknown-linux-gnu github-token: ${{ secrets.GITHUB_TOKEN }} - - name: Test with pytest working-directory: ./python run: | diff --git a/.github/workflows/run-ort-tools/action.yml b/.github/workflows/run-ort-tools/action.yml index 5686f21b58..2b55517700 100644 --- a/.github/workflows/run-ort-tools/action.yml +++ b/.github/workflows/run-ort-tools/action.yml @@ -13,11 +13,11 @@ runs: working-directory: ./ort/ shell: bash run: | - echo "Running ORT tools for ${{ inputs.folder_path }}" - FOLDER=${{ inputs.folder_path }} - mkdir $FOLDER/ort_results - # Analyzer (analyzer-result.json) - ./gradlew cli:run --args="analyze -i $FOLDER -o $FOLDER/ort_results -f JSON" - - # NOTICE DEFAULT - ./gradlew cli:run --args="report -i $FOLDER/ort_results/analyzer-result.json -o $FOLDER/ort_results/ -f PlainTextTemplate" + echo "Running ORT tools for ${{ inputs.folder_path }}" + FOLDER=${{ inputs.folder_path }} + mkdir $FOLDER/ort_results + # Analyzer (analyzer-result.json) + ./gradlew cli:run --args="analyze -i $FOLDER -o $FOLDER/ort_results -f JSON" + + # NOTICE DEFAULT + ./gradlew cli:run --args="report -i $FOLDER/ort_results/analyzer-result.json -o $FOLDER/ort_results/ -f PlainTextTemplate" diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 2fdfa77c1f..8f8f25a180 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -9,61 +9,85 @@ on: paths: - logger_core/** - glide-core/** - - glide-core/redis-rs/redis/src/** + - submodules/** - utils/cluster_manager.py - .github/workflows/rust.yml - .github/workflows/install-shared-dependencies/action.yml - - .github/workflows/install-valkey/action.yml + - .github/workflows/install-engine/action.yml - .github/workflows/lint-rust/action.yml - - .github/json_matrices/build-matrix.json + - .github/workflows/create-test-matrices/action.yml + - .github/json_matrices/** - deny.toml pull_request: paths: - logger_core/** - glide-core/** - - glide-core/redis-rs/redis/src/** + - submodules/** - utils/cluster_manager.py - .github/workflows/rust.yml - .github/workflows/install-shared-dependencies/action.yml - - .github/workflows/install-valkey/action.yml + - .github/workflows/install-engine/action.yml - .github/workflows/lint-rust/action.yml - - .github/json_matrices/build-matrix.json + - .github/workflows/create-test-matrices/action.yml + - .github/json_matrices/** - deny.toml workflow_dispatch: + inputs: + full-matrix: + description: "Run the full engine and host matrix" + type: boolean + default: false + name: + required: false + type: string + description: "(Optional) Test run name" + + workflow_call: concurrency: - group: rust-${{ github.head_ref || github.ref }} + group: rust-${{ github.head_ref || github.ref }}-${{ toJson(inputs) }} cancel-in-progress: true env: CARGO_TERM_COLOR: always +run-name: + # Set custom name if job is started manually and name is given + ${{ github.event_name == 'workflow_dispatch' && (inputs.name == '' && format('{0} @ {1} {2}', github.ref_name, github.sha, toJson(inputs)) || inputs.name) || '' }} + jobs: - load-engine-matrix: - runs-on: ubuntu-latest - outputs: - matrix: ${{ steps.load-engine-matrix.outputs.matrix }} - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Load the engine matrix - id: load-engine-matrix - shell: bash - run: echo "matrix=$(jq -c . < .github/json_matrices/engine-matrix.json)" >> $GITHUB_OUTPUT - - build: + get-matrices: runs-on: ubuntu-latest - needs: load-engine-matrix + # Avoid running on schedule for forks + if: (github.repository_owner == 'valkey-io' || github.event_name != 'schedule') || github.event_name == 'push' || github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' + outputs: + engine-matrix-output: ${{ steps.get-matrices.outputs.engine-matrix-output }} + host-matrix-output: ${{ steps.get-matrices.outputs.host-matrix-output }} + # language version matrix is omitted + + steps: + - uses: actions/checkout@v4 + - id: get-matrices + uses: ./.github/workflows/create-test-matrices + with: + language-name: rust + # Run full test matrix if job started by cron or it was explictly specified by a person who triggered the workflow + run-full-matrix: ${{ github.event.inputs.full-matrix == 'true' || github.event_name == 'schedule' }} + + tests: + runs-on: ${{ matrix.host.RUNNER }} + needs: get-matrices timeout-minutes: 15 strategy: fail-fast: false matrix: - engine: ${{ fromJson(needs.load-engine-matrix.outputs.matrix) }} + engine: ${{ fromJson(needs.get-matrices.outputs.engine-matrix-output) }} + host: ${{ fromJson(needs.get-matrices.outputs.host-matrix-output) }} steps: - uses: actions/checkout@v4 - + with: + submodules: recursive - name: Install shared software dependencies uses: ./.github/workflows/install-shared-dependencies @@ -98,7 +122,8 @@ jobs: timeout-minutes: 30 steps: - uses: actions/checkout@v4 - + with: + submodules: recursive - uses: ./.github/workflows/lint-rust with: diff --git a/.github/workflows/semgrep.yml b/.github/workflows/semgrep.yml index a9cf3db6df..3e4219bd7f 100644 --- a/.github/workflows/semgrep.yml +++ b/.github/workflows/semgrep.yml @@ -2,7 +2,7 @@ name: Semgrep on: # Scan changed files in PRs (diff-aware scanning): - pull_request: + pull_request: {} # Scan on-demand through GitHub Actions interface: workflow_dispatch: inputs: @@ -10,10 +10,7 @@ on: description: "The branch to run against the semgrep tool" required: true push: - branches: - - main - - release-* - - v* + branches: ["main"] # Schedule the CI job (this method uses cron syntax): schedule: - cron: "0 8 * * *" # Sets Semgrep to scan every day at 08:00 UTC. @@ -36,4 +33,4 @@ jobs: # Fetch project source with GitHub Actions Checkout. - uses: actions/checkout@v4 # Run the "semgrep ci" command on the command line of the docker image. - - run: semgrep ci --config auto --no-suppress-errors --exclude-rule generic.secrets.security.detected-private-key.detected-private-key + - run: semgrep ci --config auto --no-suppress-errors diff --git a/.github/workflows/setup-musl-on-linux/action.yml b/.github/workflows/setup-musl-on-linux/action.yml index f270c27507..5d69f4063d 100644 --- a/.github/workflows/setup-musl-on-linux/action.yml +++ b/.github/workflows/setup-musl-on-linux/action.yml @@ -30,28 +30,28 @@ runs: run: | apk update apk add bash git sed python3 - + - name: Skip all steps if not on ARM64 shell: bash if: ${{ inputs.arch != 'arm64' }} run: exit 0 - # Currently "Checkout" action is not supported for musl on ARM64, so the checkout is happening on the runner and + # Currently "Checkout" action is not supported for musl on ARM64, so the checkout is happening on the runner and # here we just making sure we getting the clean repo - name: Clean repository for musl on ARM64 shell: bash run: | - git config --global --add safe.directory "${{ inputs.workspace }}" - git fetch origin ${{ github.sha }} - git checkout ${{ github.sha }} - git clean -xdf - git reset --hard - + git config --global --add safe.directory "${{ inputs.workspace }}" + git fetch origin ${{ github.sha }} + git checkout ${{ github.sha }} + git clean -xdf + git reset --hard + - name: Set up access for musl on ARM shell: bash run: | chown -R $(whoami):$(whoami) $GITHUB_WORKSPACE - + - name: Setup node shell: bash working-directory: ./node diff --git a/.github/workflows/start-self-hosted-runner/action.yml b/.github/workflows/start-self-hosted-runner/action.yml index 45038b2d1d..e929e1d2d4 100644 --- a/.github/workflows/start-self-hosted-runner/action.yml +++ b/.github/workflows/start-self-hosted-runner/action.yml @@ -19,14 +19,14 @@ runs: with: role-to-assume: ${{ inputs.role-to-assume }} aws-region: ${{ inputs.aws-region }} - + - name: Start EC2 self hosted runner shell: bash run: | sudo snap refresh sudo snap install aws-cli --classic command_id=$(aws ssm send-command --instance-ids ${{ inputs.ec2-instance-id }} --document-name StartGithubSelfHostedRunner --query Command.CommandId --output text) - + while [[ "$invoke_status" != "Success" && "$invoke_status" != "Failed" ]]; do invoke_status=$(aws ssm list-command-invocations --command-id $command_id --query 'CommandInvocations[0].Status' --output text) echo "Current Status: $invoke_status" @@ -41,4 +41,4 @@ runs: fi done - echo "Final Command Status: $invoke_status" + echo "Final Command Status: $invoke_status" diff --git a/.github/workflows/test-benchmark/action.yml b/.github/workflows/test-benchmark/action.yml index 3bd50dc0f2..91cc36697f 100644 --- a/.github/workflows/test-benchmark/action.yml +++ b/.github/workflows/test-benchmark/action.yml @@ -11,8 +11,7 @@ runs: steps: - shell: bash - # Disable RDB snapshots to avoid configuration errors - run: redis-server --save "" --daemonize "yes" + run: redis-server & - shell: bash working-directory: ./benchmarks