Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions .github/actions/deploy-test-reports/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Deploy Pages
description: 'Download the artifact and deploy to GitHub Pages'

inputs:
group:
description: Group matching the artifacts
required: false
default: '*'

AWS_BUCKET_NAME_TEST:
required: true
AWS_DEFAULT_REGION:
required: true
AWS_DISTRIBUTION_ID:
required: true
AWS_ACCESS_KEY_ID:
required: true
AWS_SECRET_ACCESS_KEY:
required: true

runs:
using: 'composite'
steps:

- name: Get current date
id: date
uses: ./.github/actions/get-current-date

- name: Download artifacts
uses: actions/download-artifact@v4
with:
pattern: ${{ format('{0}*', inputs.group) }}
path: public/${{ github.run_id }}

- name: Deploy 🚀
shell: bash
env:
AWS_BUCKET_NAME_TEST: ${{ inputs.AWS_BUCKET_NAME_TEST }}
AWS_DEFAULT_REGION: ${{ inputs.AWS_DEFAULT_REGION }}
AWS_DISTRIBUTION_ID: ${{ inputs.AWS_DISTRIBUTION_ID }}
AWS_ACCESS_KEY_ID: ${{ inputs.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ inputs.AWS_SECRET_ACCESS_KEY }}
run: |

SUB_PATH=test-reports/${{ steps.date.outputs.date }}

aws s3 cp public/ s3://${AWS_BUCKET_NAME_TEST}/public/${SUB_PATH} --recursive


23 changes: 23 additions & 0 deletions .github/actions/remove-artifacts/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Remove all artifacts

runs:
using: 'composite'
steps:
- name: Merge artifacts by pattern
id: merge-artifacts
uses: actions/upload-artifact/merge@v4
with:
name: remove-artifacts
pattern: '*'
delete-merged: true

- name: Delete merged artifact
uses: actions/github-script@v7
with:
script: |
github.rest.actions.deleteArtifact({
owner: context.repo.owner,
repo: context.repo.repo,
artifact_id: ${{ steps.merge-artifacts.outputs.artifact-id }}
});

4 changes: 2 additions & 2 deletions .github/generate-build-summary.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const fs = require('fs')
const path = require('path')

const { writeFile } = fs.promises
const { appendFile } = fs.promises

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

Expand Down Expand Up @@ -66,7 +66,7 @@ async function generateBuildSummary() {
const data = markdownLines.join('\n')
const summaryFilePath = GITHUB_STEP_SUMMARY

await writeFile(summaryFilePath, data, { encoding: 'utf8' })
await appendFile(summaryFilePath, data, { encoding: 'utf8' })

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

Expand Down
34 changes: 13 additions & 21 deletions .github/workflows/aws-upload-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,43 +25,35 @@ jobs:
id: date
uses: ./.github/actions/get-current-date

- name: Merge builds by pattern
id: merge-builds
uses: actions/upload-artifact/merge@v4
with:
name: 'all-builds'
pattern: '*-builds'
delete-merged: true

- name: Download builds
uses: actions/download-artifact@v4
with:
name: 'all-builds'
pattern: '*-builds'
path: release
merge-multiple: true

- run: ls -R ./release

- name: Set sub path for dev builds
- name: Upload builds to s3 bucket dev sub folder
if: ${{ !inputs.pre-release }}
run: |
echo "SUB_PATH=dev-builds/${{ steps.date.outputs.date }}/${{ github.run_id }}" >> $GITHUB_ENV
SUB_PATH="dev-builds/${{ steps.date.outputs.date }}/${{ github.run_id }}"
echo "SUB_PATH=${SUB_PATH}" >> $GITHUB_ENV

- name: Set sub path for pre-release builds
aws s3 cp release/ s3://${AWS_BUCKET_NAME_TEST}/public/${SUB_PATH} --recursive

- name: Upload builds to s3 bucket pre-releasea sub folder
if: inputs.pre-release
run: |
APP_VERSION=$(jq -r '.version' redisinsight/package.json)
echo "SUB_PATH=pre-release/${APP_VERSION}" >> $GITHUB_ENV
SUB_PATH="pre-release/${APP_VERSION}"

- name: Upload builds to s3 bucket
run: |
aws s3 cp release/ s3://${AWS_BUCKET_NAME_TEST}/public/${SUB_PATH} --recursive
echo "SUB_PATH=${SUB_PATH}" >> $GITHUB_ENV

aws s3 cp release/ s3://${AWS_BUCKET_NAME_TEST}/public/upgrades --recursive
aws s3 cp release/ s3://${AWS_BUCKET_NAME_TEST}/public/pre-release/${APP_VERSION} --recursive

- name: Generate job summary
run: |
node ./.github/generate-build-summary.js

# Remove artifacts from github actions
remove-artifacts:
name: Remove artifacts
uses: ./.github/workflows/remove-artifacts.yml
needs: 's3'
6 changes: 0 additions & 6 deletions .github/workflows/aws-upload-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,6 @@ jobs:

aws s3 cp release/ s3://${AWS_BUCKET_NAME}/private/${applicationVersion} --recursive

# Remove artifacts from github actions
remove-artifacts:
name: Remove artifacts
uses: ./.github/workflows/remove-artifacts.yml
needs: 'release-private'

release-public:
name: Release s3 public
runs-on: ubuntu-latest
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/clean-s3-dev-builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,12 @@ jobs:
deleting:
runs-on: ubuntu-latest
steps:
- name: Deleting builds older than 7 days
- name: Deleting builds and test reports older than 7 days
continue-on-error: true
run: |
DATE=$(date +'%Y-%m-%d')
DATE_EPIRED=$(date -d "$DATE - 7 days" +'%Y-%m-%d')

aws s3 rm s3://${AWS_BUCKET_NAME_TEST}/public/dev-builds/${DATE_EPIRED} --recursive
aws s3 rm s3://${AWS_BUCKET_NAME_TEST}/public/test-reports/${DATE_EPIRED} --recursive

28 changes: 0 additions & 28 deletions .github/workflows/deploy-pages.yml

This file was deleted.

12 changes: 12 additions & 0 deletions .github/workflows/manual-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,3 +98,15 @@ jobs:
needs: [aws-upload]
if: always()

# Remove artifacts from github actions
remove-artifacts:
name: Remove artifacts
needs: [aws-upload]
if: always()
runs-on: ubuntu-latest

steps:
- name: Remove all artifacts
uses: ./.github/actions/remove-artifacts


2 changes: 1 addition & 1 deletion .github/workflows/pipeline-build-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ jobs:
ARCH=x64 ./.github/redisstack/dmg.repack.sh
ARCH=arm64 ./.github/redisstack/dmg.repack.sh

- name: Upload x64 packages
- name: Upload macos packages
uses: actions/upload-artifact@v4
with:
name: macos-builds
Expand Down
14 changes: 10 additions & 4 deletions .github/workflows/release-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,13 @@ jobs:
needs: aws-upload-prod
secrets: inherit

# Cancel a previous run workflow
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
# Remove artifacts from github actions
remove-artifacts:
name: Remove artifacts
needs: [aws-upload-prod, e2e-docker-tests, e2e-appimage-tests]
if: always()
runs-on: ubuntu-latest

steps:
- name: Remove all artifacts
uses: ./.github/actions/remove-artifacts
15 changes: 11 additions & 4 deletions .github/workflows/release-stage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ jobs:
aws:
uses: ./.github/workflows/aws-upload-dev.yml
needs: [builds]
secrets: inherit
if: always()
with:
pre-release: true
Expand All @@ -40,7 +41,13 @@ jobs:
uses: ./.github/workflows/tests-e2e-appimage.yml
secrets: inherit

# Cancel a previous run workflow
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
# Remove artifacts from github actions
remove-artifacts:
name: Remove artifacts
needs: [aws, e2e-docker-tests, e2e-appimage-tests]
if: always()
runs-on: ubuntu-latest

steps:
- name: Remove all artifacts
uses: ./.github/actions/remove-artifacts # Remove artifacts from github actions
33 changes: 0 additions & 33 deletions .github/workflows/remove-artifacts.yml

This file was deleted.

32 changes: 21 additions & 11 deletions .github/workflows/tests-backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,12 @@ on:
env:
SLACK_AUDIT_REPORT_CHANNEL: ${{ secrets.SLACK_AUDIT_REPORT_CHANNEL }}
SLACK_AUDIT_REPORT_KEY: ${{ secrets.SLACK_AUDIT_REPORT_KEY }}
DEFAULT_GITHUB_PAGES_URL: ${{ vars.DEFAULT_GITHUB_PAGES_URL }}
REPORT_NAME: "report-be"

jobs:
unit-tests:
name: Unit tests
runs-on: ubuntu-latest
environment:
name: staging
url: ${{ env.DEFAULT_GITHUB_PAGES_URL }}/${{ github.run_id }}/${{ env.REPORT_NAME }}
steps:
- uses: actions/checkout@v4

Expand Down Expand Up @@ -64,10 +60,24 @@ jobs:
name: ${{ env.REPORT_NAME }}
path: redisinsight/api/report

deploy-pages:
name: Deploy report
uses: ./.github/workflows/deploy-pages.yml
needs: 'unit-tests'
if: always()
with:
group: 'report'
- name: Deploy report
uses: ./.github/actions/deploy-test-reports
if: always()
with:
group: 'report'
AWS_BUCKET_NAME_TEST: ${{ vars.AWS_BUCKET_NAME_TEST }}
AWS_DEFAULT_REGION: ${{ vars.AWS_DEFAULT_REGION }}
AWS_DISTRIBUTION_ID: ${{ secrets.AWS_DISTRIBUTION_ID }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}

- name: Get current date
id: date
if: always()
uses: ./.github/actions/get-current-date

- name: Add link to report in the workflow summary
if: always()
run: |
link="${{ vars.DEFAULT_TEST_REPORTS_URL }}/${{ steps.date.outputs.date }}/${{ github.run_id }}/${{ env.REPORT_NAME }}/index.html"
echo "[${link}](${link})" >> $GITHUB_STEP_SUMMARY
Loading
Loading