Skip to content

Commit 060ffbd

Browse files
committed
Merge branch 'main' into try_fix_macos_builds
2 parents d9f6e88 + 9f40330 commit 060ffbd

File tree

70 files changed

+1372
-473
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+1372
-473
lines changed

.circleci/config.yml.backup

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -396,15 +396,36 @@ jobs:
396396
- attach_workspace:
397397
at: .
398398
- run: sudo apt-get install net-tools
399+
- run: sudo apt-get install xdotool
400+
- run: sudo apt-get install -y desktop-file-utils
401+
- run:
402+
name: Install Google Chrome
403+
command: |
404+
wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
405+
sudo sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list'
406+
sudo apt-get update
407+
sudo apt-get install -y google-chrome-stable
408+
sudo apt-get install -y \
409+
libnss3 \
410+
libgconf-2-4 \
411+
libxss1 \
412+
libasound2
413+
xdg-settings set default-web-browser google-chrome.desktop
399414
- run:
400415
name: Install WM
401416
command: sudo apt install fluxbox
402417
- run:
403-
name: Run X11
418+
name: Install Xvfb
419+
command: sudo apt-get install -y xvfb
420+
- run:
421+
name: Start Xvfb
404422
command: |
405-
Xvfb :99 -screen 0 1920x1080x24 &
423+
if [ -f /tmp/.X99-lock ]; then rm /tmp/.X99-lock; fi
424+
Xvfb :99 -ac -screen 0 1920x1080x24 &
406425
sleep 3
407426
fluxbox &
427+
export DISPLAY=:99
428+
echo $DISPLAY
408429
# - run:
409430
# name: Clone mocked RDI server
410431
# command: |

.circleci/e2e/test.app-image.sh

Lines changed: 38 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,52 @@ set -e
33

44
yarn --cwd tests/e2e install
55

6-
# mount app resources
7-
./release/*.AppImage --appimage-mount >> apppath &
6+
# Create the ri-test directory if it doesn't exist
7+
mkdir -p ri-test
8+
9+
# Extract the AppImage
10+
chmod +x ./release/*.AppImage
11+
./release/*.AppImage --appimage-extract
12+
13+
# Move contents of squashfs-root to ri-test and remove squashfs-root folder
14+
mv squashfs-root/* ri-test/
15+
rm -rf squashfs-root
16+
17+
# Export custom XDG_DATA_DIRS with ri-test
18+
export XDG_DATA_DIRS="$(pwd)/ri-test:$XDG_DATA_DIRS"
819

920
# create folder before tests run to prevent permissions issue
1021
mkdir -p tests/e2e/remote
1122
mkdir -p tests/e2e/rdi
1223

13-
# run rte
24+
# Create a custom .desktop file for RedisInsight
25+
cat > ri-test/redisinsight.desktop <<EOL
26+
[Desktop Entry]
27+
Version=1.0
28+
Name=RedisInsight
29+
Exec=$(pwd)/ri-test/redisinsight %u
30+
Icon=$(pwd)/ri-test/resources/app.asar/img/icon.png
31+
Type=Application
32+
Terminal=false
33+
MimeType=x-scheme-handler/redisinsight;
34+
EOL
35+
36+
# Copy the .desktop file to the local applications directory
37+
cp ri-test/redisinsight.desktop "$HOME/.local/share/applications"
38+
39+
# Update the desktop database with custom directory
40+
update-desktop-database "$(pwd)/ri-test/"
41+
42+
# Register the RedisInsight deeplink protocol
43+
xdg-mime default redisinsight.desktop x-scheme-handler/redisinsight
44+
45+
# Run rte
1446
docker-compose -f tests/e2e/rte.docker-compose.yml build
1547
docker-compose -f tests/e2e/rte.docker-compose.yml up --force-recreate -d -V
1648
./tests/e2e/wait-for-redis.sh localhost 12000 && \
1749

18-
# run tests
19-
COMMON_URL=$(tail -n 1 apppath)/resources/app.asar/dist/renderer/index.html \
20-
ELECTRON_PATH=$(tail -n 1 apppath)/redisinsight \
50+
# Run tests
51+
COMMON_URL=$(pwd)/ri-test/resources/app.asar/dist/renderer/index.html \
52+
ELECTRON_PATH=$(pwd)/ri-test/redisinsight \
2153
RI_SOCKETS_CORS=true \
2254
yarn --cwd tests/e2e dotenv -e .desktop.env yarn --cwd tests/e2e test:desktop:ci
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Deploy Pages
2+
description: 'Download the artifact and deploy to GitHub Pages'
3+
4+
inputs:
5+
group:
6+
description: Group matching the artifacts
7+
required: false
8+
default: '*'
9+
10+
AWS_BUCKET_NAME_TEST:
11+
required: true
12+
AWS_DEFAULT_REGION:
13+
required: true
14+
AWS_DISTRIBUTION_ID:
15+
required: true
16+
AWS_ACCESS_KEY_ID:
17+
required: true
18+
AWS_SECRET_ACCESS_KEY:
19+
required: true
20+
21+
runs:
22+
using: 'composite'
23+
steps:
24+
25+
- name: Get current date
26+
id: date
27+
uses: ./.github/actions/get-current-date
28+
29+
- name: Download artifacts
30+
uses: actions/download-artifact@v4
31+
with:
32+
pattern: ${{ format('{0}*', inputs.group) }}
33+
path: public/${{ github.run_id }}
34+
35+
- name: Deploy 🚀
36+
shell: bash
37+
env:
38+
AWS_BUCKET_NAME_TEST: ${{ inputs.AWS_BUCKET_NAME_TEST }}
39+
AWS_DEFAULT_REGION: ${{ inputs.AWS_DEFAULT_REGION }}
40+
AWS_DISTRIBUTION_ID: ${{ inputs.AWS_DISTRIBUTION_ID }}
41+
AWS_ACCESS_KEY_ID: ${{ inputs.AWS_ACCESS_KEY_ID }}
42+
AWS_SECRET_ACCESS_KEY: ${{ inputs.AWS_SECRET_ACCESS_KEY }}
43+
run: |
44+
45+
SUB_PATH=test-reports/${{ steps.date.outputs.date }}
46+
47+
aws s3 cp public/ s3://${AWS_BUCKET_NAME_TEST}/public/${SUB_PATH} --recursive
48+
49+
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Remove all artifacts
2+
3+
runs:
4+
using: 'composite'
5+
steps:
6+
- name: Merge artifacts by pattern
7+
id: merge-artifacts
8+
uses: actions/upload-artifact/merge@v4
9+
with:
10+
name: remove-artifacts
11+
pattern: '*'
12+
delete-merged: true
13+
14+
- name: Delete merged artifact
15+
uses: actions/github-script@v7
16+
with:
17+
script: |
18+
github.rest.actions.deleteArtifact({
19+
owner: context.repo.owner,
20+
repo: context.repo.repo,
21+
artifact_id: ${{ steps.merge-artifacts.outputs.artifact-id }}
22+
});
23+

.github/e2e/test.app-image.sh

Lines changed: 37 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,52 @@ set -e
33

44
yarn --cwd tests/e2e install
55

6-
# mount app resources
6+
# Create the ri-test directory if it doesn't exist
7+
mkdir -p ri-test
8+
9+
# Extract the AppImage
710
chmod +x ./release/*.AppImage
8-
./release/*.AppImage --appimage-mount >> apppath &
11+
./release/*.AppImage --appimage-extract
12+
13+
# Move contents of squashfs-root to ri-test and remove squashfs-root folder
14+
mv squashfs-root/* ri-test/
15+
rm -rf squashfs-root
16+
17+
# Export custom XDG_DATA_DIRS with ri-test
18+
export XDG_DATA_DIRS="$(pwd)/ri-test:$XDG_DATA_DIRS"
919

1020
# create folder before tests run to prevent permissions issue
1121
mkdir -p tests/e2e/remote
1222
mkdir -p tests/e2e/rdi
1323

14-
# run rte
24+
# Create a custom .desktop file for RedisInsight
25+
cat > ri-test/redisinsight.desktop <<EOL
26+
[Desktop Entry]
27+
Version=1.0
28+
Name=RedisInsight
29+
Exec=$(pwd)/ri-test/redisinsight %u
30+
Icon=$(pwd)/ri-test/resources/app.asar/img/icon.png
31+
Type=Application
32+
Terminal=false
33+
MimeType=x-scheme-handler/redisinsight;
34+
EOL
35+
36+
# Copy the .desktop file to the local applications directory
37+
cp ri-test/redisinsight.desktop "$HOME/.local/share/applications"
38+
39+
# Update the desktop database with custom directory
40+
update-desktop-database "$(pwd)/ri-test/"
41+
42+
# Register the RedisInsight deeplink protocol
43+
xdg-mime default redisinsight.desktop x-scheme-handler/redisinsight
44+
45+
# Run rte
1546
docker compose -f tests/e2e/rte.docker-compose.yml build
1647
docker compose -f tests/e2e/rte.docker-compose.yml up --force-recreate -d -V
1748
./tests/e2e/wait-for-redis.sh localhost 12000 && \
1849

19-
# run tests
20-
COMMON_URL=$(tail -n 1 apppath)/resources/app.asar/dist/renderer/index.html \
21-
ELECTRON_PATH=$(tail -n 1 apppath)/redisinsight \
50+
# Run tests
51+
COMMON_URL=$(pwd)/ri-test/resources/app.asar/dist/renderer/index.html \
52+
ELECTRON_PATH=$(pwd)/ri-test/redisinsight \
2253
RI_SOCKETS_CORS=true \
2354
yarn --cwd tests/e2e dotenv -e .desktop.env yarn --cwd tests/e2e test:desktop:ci

.github/generate-build-summary.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
const fs = require('fs')
22
const path = require('path')
33

4-
const { writeFile } = fs.promises
4+
const { appendFile } = fs.promises
55

66
const { AWS_DEFAULT_REGION, AWS_BUCKET_NAME_TEST, SUB_PATH, GITHUB_STEP_SUMMARY } = process.env;
77

@@ -66,7 +66,7 @@ async function generateBuildSummary() {
6666
const data = markdownLines.join('\n')
6767
const summaryFilePath = GITHUB_STEP_SUMMARY
6868

69-
await writeFile(summaryFilePath, data, { encoding: 'utf8' })
69+
await appendFile(summaryFilePath, data, { encoding: 'utf8' })
7070

7171
console.log('Build summary generated successfully.')
7272

.github/workflows/aws-upload-dev.yml

Lines changed: 13 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -25,43 +25,35 @@ jobs:
2525
id: date
2626
uses: ./.github/actions/get-current-date
2727

28-
- name: Merge builds by pattern
29-
id: merge-builds
30-
uses: actions/upload-artifact/merge@v4
31-
with:
32-
name: 'all-builds'
33-
pattern: '*-builds'
34-
delete-merged: true
35-
3628
- name: Download builds
3729
uses: actions/download-artifact@v4
3830
with:
39-
name: 'all-builds'
31+
pattern: '*-builds'
4032
path: release
33+
merge-multiple: true
4134

4235
- run: ls -R ./release
4336

44-
- name: Set sub path for dev builds
37+
- name: Upload builds to s3 bucket dev sub folder
4538
if: ${{ !inputs.pre-release }}
4639
run: |
47-
echo "SUB_PATH=dev-builds/${{ steps.date.outputs.date }}/${{ github.run_id }}" >> $GITHUB_ENV
40+
SUB_PATH="dev-builds/${{ steps.date.outputs.date }}/${{ github.run_id }}"
41+
echo "SUB_PATH=${SUB_PATH}" >> $GITHUB_ENV
4842
49-
- name: Set sub path for pre-release builds
43+
aws s3 cp release/ s3://${AWS_BUCKET_NAME_TEST}/public/${SUB_PATH} --recursive
44+
45+
- name: Upload builds to s3 bucket pre-releasea sub folder
5046
if: inputs.pre-release
5147
run: |
5248
APP_VERSION=$(jq -r '.version' redisinsight/package.json)
53-
echo "SUB_PATH=pre-release/${APP_VERSION}" >> $GITHUB_ENV
49+
SUB_PATH="pre-release/${APP_VERSION}"
5450
55-
- name: Upload builds to s3 bucket
56-
run: |
57-
aws s3 cp release/ s3://${AWS_BUCKET_NAME_TEST}/public/${SUB_PATH} --recursive
51+
echo "SUB_PATH=${SUB_PATH}" >> $GITHUB_ENV
52+
53+
aws s3 cp release/ s3://${AWS_BUCKET_NAME_TEST}/public/upgrades --recursive
54+
aws s3 cp release/ s3://${AWS_BUCKET_NAME_TEST}/public/pre-release/${APP_VERSION} --recursive
5855
5956
- name: Generate job summary
6057
run: |
6158
node ./.github/generate-build-summary.js
6259
63-
# Remove artifacts from github actions
64-
remove-artifacts:
65-
name: Remove artifacts
66-
uses: ./.github/workflows/remove-artifacts.yml
67-
needs: 's3'

.github/workflows/aws-upload-prod.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,6 @@ jobs:
4141
4242
aws s3 cp release/ s3://${AWS_BUCKET_NAME}/private/${applicationVersion} --recursive
4343
44-
# Remove artifacts from github actions
45-
remove-artifacts:
46-
name: Remove artifacts
47-
uses: ./.github/workflows/remove-artifacts.yml
48-
needs: 'release-private'
49-
5044
release-public:
5145
name: Release s3 public
5246
runs-on: ubuntu-latest

.github/workflows/clean-deployments.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44

55
jobs:
66
clean:
7+
name: Clean deployments
78
runs-on: ubuntu-latest
89
steps:
910
- name: 🗑 Delete deployment (staging)

.github/workflows/clean-s3-dev-builds.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,12 @@ jobs:
1313
deleting:
1414
runs-on: ubuntu-latest
1515
steps:
16-
- name: Deleting builds older than 7 days
16+
- name: Deleting builds and test reports older than 7 days
1717
continue-on-error: true
1818
run: |
1919
DATE=$(date +'%Y-%m-%d')
2020
DATE_EPIRED=$(date -d "$DATE - 7 days" +'%Y-%m-%d')
2121
2222
aws s3 rm s3://${AWS_BUCKET_NAME_TEST}/public/dev-builds/${DATE_EPIRED} --recursive
23+
aws s3 rm s3://${AWS_BUCKET_NAME_TEST}/public/test-reports/${DATE_EPIRED} --recursive
2324

0 commit comments

Comments
 (0)