Skip to content

Commit

Permalink
address comments, revert files, add back in missing test
Browse files Browse the repository at this point in the history
Signed-off-by: Chloe Yip <chloe.yip@improving.com>
  • Loading branch information
cyip10 committed Sep 12, 2024
1 parent b52757d commit 5cd3427
Show file tree
Hide file tree
Showing 8 changed files with 262 additions and 249 deletions.
24 changes: 12 additions & 12 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@ name: "CodeQL"

on:
push:
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]+"
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]+"
pull_request:
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]+"
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]+"
schedule:
- cron: "37 18 * * 6"

Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/csharp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,16 @@ jobs:
load-engine-matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.load-engine-matrix.outputs.matrix }}
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

run-tests:
needs: load-engine-matrix
timeout-minutes: 25
Expand All @@ -68,7 +68,7 @@ jobs:
# RUNNER: macos-latest,
# TARGET: aarch64-apple-darwin
# }

runs-on: ${{ matrix.host.RUNNER }}

steps:
Expand All @@ -80,7 +80,7 @@ jobs:
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ matrix.dotnet }}

- name: Install shared software dependencies
uses: ./.github/workflows/install-shared-dependencies
with:
Expand Down Expand Up @@ -112,7 +112,7 @@ jobs:
benchmarks/results/*
utils/clusters/**
# TODO Add amazonlinux
# TODO Add amazonlinux

lint-rust:
timeout-minutes: 10
Expand Down
18 changes: 16 additions & 2 deletions .github/workflows/java-cd.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Create Workflow
name: Java Prepare Deployment

on:
push:
Expand All @@ -24,6 +24,7 @@ permissions:
jobs:
load-platform-matrix:
runs-on: ubuntu-latest
environment: AWS_ACTIONS
outputs:
PLATFORM_MATRIX: ${{ steps.load-platform-matrix.outputs.PLATFORM_MATRIX }}
steps:
Expand Down Expand Up @@ -273,6 +274,20 @@ jobs:
brew services stop redis
fi
publish-release-to-maven:
if: ${{ inputs.maven_publish == true || github.event_name == 'push' }}
needs: [publish-to-maven-central-deployment]
runs-on: ubuntu-latest
environment: AWS_ACTIONS
env:
DEPLOYMENT_ID: ${{ needs.publish-to-maven-central-deployment.outputs.DEPLOYMENT_ID }}
steps:
- name: Publish to Maven
run: |
curl --request POST \
-u "${{ secrets.CENTRAL_TOKEN_USERNAME }}:${{ secrets.CENTRAL_TOKEN_PASSWORD }}" \
"https://central.sonatype.com/api/v1/publisher/deployment/${{ env.DEPLOYMENT_ID }}"
drop-deployment-if-validation-fails:
if: ${{ failure() }}
needs: [publish-to-maven-central-deployment, test-deployment-on-all-architectures]
Expand All @@ -283,7 +298,6 @@ jobs:
- name: Drop deployment if validation fails
run: |
curl --request DELETE \
--verbose \
-u "${{ secrets.CENTRAL_TOKEN_USERNAME }}:${{ secrets.CENTRAL_TOKEN_PASSWORD }}" \
"https://central.sonatype.com/api/v1/publisher/deployment/${{ env.DEPLOYMENT_ID }}"
112 changes: 56 additions & 56 deletions .github/workflows/npm-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,47 +4,47 @@ 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-valkey/action.yml
- .github/json_matrices/build-matrix.json
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 }}
cancel-in-progress: true

permissions:
id-token: write
id-token: write

jobs:
start-self-hosted-runner:
if: github.repository_owner == 'valkey-io'
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
Expand All @@ -58,9 +58,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 | 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]
Expand All @@ -73,7 +73,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' }}
Expand All @@ -85,7 +85,7 @@ jobs:
run: |
apk update
apk add git
- name: Checkout
if: ${{ matrix.build.TARGET != 'aarch64-unknown-linux-musl' }}
uses: actions/checkout@v4
Expand All @@ -100,7 +100,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
Expand All @@ -114,8 +114,8 @@ 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: ${{ matrix.build.TARGET != 'aarch64-unknown-linux-musl' }}
Expand All @@ -127,15 +127,15 @@ jobs:
scope: "${{ vars.NPM_SCOPE }}"
always-auth: true
token: ${{ secrets.NPM_AUTH_TOKEN }}

- name: Setup node for publishing
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:
Expand All @@ -153,7 +153,7 @@ jobs:
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: |
Expand All @@ -170,9 +170,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'
Expand All @@ -183,7 +183,7 @@ jobs:
set +e
# 2>&1 1>&3- redirects stderr to stdout and then redirects the original stdout to another file descriptor,
# effectively separating stderr and stdout. The 3>&1 at the end redirects the original stdout back to the console.
# https://github.com/npm/npm/issues/118#issuecomment-325440 - ignoring notice messages since currentlly they are directed to stderr
# https://github.com/npm/npm/issues/118#issuecomment-325440 - ignoring notice messages since currentlly they are directed to stderr
{ npm_publish_err=$(npm publish --tag ${{ env.NPM_TAG }} --access public 2>&1 1>&3- | grep -v "notice") ;} 3>&1
if [[ "$npm_publish_err" == *"You cannot publish over the previously published versions"* ]]
then
Expand All @@ -202,8 +202,8 @@ jobs:
if: ${{ matrix.build.ARCH == 'arm64' }}
shell: bash
run: |
git reset --hard
git clean -xdf
git reset --hard
git clean -xdf
publish-base-to-npm:
if: github.event_name != 'pull_request'
Expand Down Expand Up @@ -247,7 +247,7 @@ jobs:
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: |
Expand All @@ -260,7 +260,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
Expand All @@ -285,7 +285,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' }}
Expand All @@ -294,20 +294,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'}}
Expand Down Expand Up @@ -370,5 +370,5 @@ jobs:
if: ${{ contains(matrix.build.RUNNER, 'self-hosted') }}
shell: bash
run: |
git reset --hard
git clean -xdf
git reset --hard
git clean -xdf
Loading

0 comments on commit 5cd3427

Please sign in to comment.