Skip to content

Commit

Permalink
Refactor CI workflows to streamline engine installation and improve s…
Browse files Browse the repository at this point in the history
…etup for self-hosted runners

Signed-off-by: avifenesh <[email protected]>
  • Loading branch information
avifenesh committed Dec 29, 2024
1 parent 0bcca10 commit f4392a3
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 33 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/java-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,10 @@ jobs:
host: ${{ fromJson(needs.load-platform-matrix.outputs.PLATFORM_MATRIX) }}
runs-on: ${{ matrix.host.RUNNER }}
steps:
- name: Setup self-hosted runner access
if: ${{matrix.host.TARGET == 'aarch64-unknown-linux-gnu' }}
run: sudo chown -R $USER:$USER /home/ubuntu/action-runner-ilia/_work/valkey-glide

- name: Checkout
uses: actions/checkout@v4

Expand Down
20 changes: 11 additions & 9 deletions .github/workflows/npm-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -308,23 +308,18 @@ jobs:
if: ${{ matrix.build.TARGET == 'aarch64-unknown-linux-gnu' }}
run: sudo chown -R $USER:$USER /home/ubuntu/actions-runner/_work/valkey-glide

- name: install Redis and git for alpine
- name: install redis and git for alpine
if: ${{ contains(matrix.build.TARGET, 'musl') }}
run: |
apk update
apk add redis git
apk add git redis
node -v
- name: install Redis and Python for ubuntu
- name: install Python for ubuntu
if: ${{ contains(matrix.build.TARGET, 'linux-gnu') }}
run: |
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
sudo apt-get install python3
- name: Checkout
if: ${{ matrix.build.TARGET != 'aarch64-unknown-linux-musl'}}
Expand All @@ -339,6 +334,13 @@ jobs:
npm-auth-token: ${{ secrets.NPM_AUTH_TOKEN }}
arch: ${{ matrix.build.ARCH }}

- name: Install engine
if: ${{ !contains(matrix.build.TARGET, 'musl') }}
uses: ./.github/workflows/install-engine
with:
engine-version: "8.0"
target: ${{ matrix.build.target }}

- name: Setup node
if: ${{ !contains(matrix.build.TARGET, 'musl') }}
uses: actions/setup-node@v4
Expand Down
29 changes: 5 additions & 24 deletions .github/workflows/pypi-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -232,31 +232,12 @@ jobs:
with:
python-version: 3.12

- name: Install engine Ubuntu ARM
if: ${{ matrix.build.TARGET == 'aarch64-unknown-linux-gnu' }}
shell: bash
# in self hosted runner we first want to check that engine is not already installed
run: |
if [[ $(`which redis-server`) == '' ]]
then
sudo apt-get update
sudo apt-get install -y redis-server
else
echo "Redis is already installed"
fi
- name: Install engine Ubuntu x86
if: ${{ matrix.build.TARGET == 'x86_64-unknown-linux-gnu' }}
shell: bash
run: |
sudo apt-get update
sudo apt-get install -y redis-server
- name: Install engine
uses: ./.github/workflows/install-engine
with:
engine-version: "8.0"
target: ${{ matrix.build.target }}

- name: Install engine MacOS
if: ${{ matrix.build.OS == 'macos' }}
shell: bash
run: |
brew install redis

- name: Check if RC and set a distribution tag for the package
shell: bash
Expand Down

0 comments on commit f4392a3

Please sign in to comment.