Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update 2.x to be same as Reporting Repo #2

Merged
merged 5 commits into from
Jan 5, 2023
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
155 changes: 38 additions & 117 deletions .github/workflows/dashboards-reports-test-and-build-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ jobs:
linux-build:
runs-on: ubuntu-latest
steps:
- name: Checkout Plugin
uses: actions/checkout@v1

- name: Checkout OpenSearch Dashboards
uses: actions/checkout@v1
with:
Expand All @@ -25,90 +22,54 @@ jobs:

- name: Get node version
id: versions_step
run:
echo "::set-output name=node_version::$(node -p "(require('../OpenSearch-Dashboards/package.json').engines.node).match(/[.0-9]+/)[0]")"
run: echo "::set-output name=node_version::$(node -p "(require('../OpenSearch-Dashboards/package.json').engines.node).match(/[.0-9]+/)[0]")"

- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: ${{ steps.versions_step.outputs.node_version }}
registry-url: 'https://registry.npmjs.org'


- name: Move Dashboards Reports to Plugins Dir
run: mv dashboards-reports ../OpenSearch-Dashboards/plugins/${{ env.PLUGIN_NAME }}

- name: Add Chromium Binary to Reporting for Testing
run: |
sudo apt update
sudo apt install -y libnss3-dev fonts-liberation libfontconfig1
cd ../OpenSearch-Dashboards/plugins/${{ env.PLUGIN_NAME }}
wget https://github.com/opendistro-for-elasticsearch/kibana-reports/releases/download/chromium-1.12.0.0/chromium-linux-x64.zip
unzip chromium-linux-x64.zip
rm chromium-linux-x64.zip
- name: Checkout Plugin
uses: actions/checkout@v1
with:
path: OpenSearch-Dashboards/plugins/${{ env.PLUGIN_NAME }}

- name: OpenSearch Dashboards Plugin Bootstrap
uses: nick-invision/retry@v1
uses: nick-fields/retry@v1
with:
timeout_minutes: 30
max_attempts: 3
command: cd ../OpenSearch-Dashboards/plugins/${{ env.PLUGIN_NAME }}; yarn osd bootstrap
command: yarn osd bootstrap

- name: Test
uses: nick-invision/retry@v1
uses: nick-fields/retry@v1
with:
timeout_minutes: 30
max_attempts: 3
command: cd ../OpenSearch-Dashboards/plugins/${{ env.PLUGIN_NAME }}; yarn test --coverage
command: yarn test --coverage

- name: Upload coverage
uses: codecov/codecov-action@v1
with:
flags: dashboards-reports
directory: ../OpenSearch-Dashboards/plugins/
flags: dashboards-report
directory: ./OpenSearch-Dashboards/plugins/
token: ${{ secrets.CODECOV_TOKEN }}

- name: Build Artifact
run: |
cd ../OpenSearch-Dashboards/plugins/${{ env.PLUGIN_NAME }}
yarn build
mv ./build/*.zip ./build/${{ env.ARTIFACT_NAME }}-${{ env.OPENSEARCH_PLUGIN_VERSION }}.zip

cd build
mkdir -p ./{linux-x64,linux-arm64}/opensearch-dashboards/${{ env.PLUGIN_NAME }}
cp ./${{ env.PLUGIN_NAME }}-*.zip ./linux-x64/${{ env.ARTIFACT_NAME }}-${{ env.OPENSEARCH_PLUGIN_VERSION }}-linux-x64.zip
cp ./${{ env.PLUGIN_NAME }}-*.zip ./linux-arm64/${{ env.ARTIFACT_NAME }}-${{ env.OPENSEARCH_PLUGIN_VERSION }}-linux-arm64.zip

cd linux-x64
wget https://github.com/opensearch-project/dashboards-reports/releases/download/chromium-1.12.0.0/chromium-linux-x64.zip
unzip chromium-linux-x64.zip -d ./opensearch-dashboards/${{ env.PLUGIN_NAME }}
zip -ur ./${{ env.ARTIFACT_NAME }}-*.zip ./opensearch-dashboards
mv ./${{ env.ARTIFACT_NAME }}-*.zip ..
cd ..

cd linux-arm64
wget https://github.com/opensearch-project/dashboards-reports/releases/download/chromium-1.12.0.0/chromium-linux-arm64.zip
unzip chromium-linux-arm64.zip -d ./opensearch-dashboards/${{ env.PLUGIN_NAME }}
zip -ur ./${{ env.ARTIFACT_NAME }}-*.zip ./opensearch-dashboards
mv ./${{ env.ARTIFACT_NAME }}-*.zip ..
cd ..

- name: Upload Artifact For Linux x64
- name: Upload Artifact For Linux
uses: actions/upload-artifact@v1
with:
name: dashboards-reports-linux-x64
path: ../OpenSearch-Dashboards/plugins/${{ env.PLUGIN_NAME }}/build/${{ env.ARTIFACT_NAME }}-${{ env.OPENSEARCH_PLUGIN_VERSION }}-linux-x64.zip

- name: Upload Artifact For Linux arm64
uses: actions/upload-artifact@v1
with:
name: dashboards-reports-linux-arm64
path: ../OpenSearch-Dashboards/plugins/${{ env.PLUGIN_NAME }}/build/${{ env.ARTIFACT_NAME }}-${{ env.OPENSEARCH_PLUGIN_VERSION }}-linux-arm64.zip
name: dashboards-reports-linux
path: ./build/${{ env.ARTIFACT_NAME }}-${{ env.OPENSEARCH_PLUGIN_VERSION }}.zip

windows-build:
runs-on: windows-latest
steps:
- name: Checkout Plugin
uses: actions/checkout@v1

# Enable longer filenames for windows
- name: Enable longer filenames
Expand All @@ -133,63 +94,39 @@ jobs:
registry-url: 'https://registry.npmjs.org'


- name: Move Dashboards Reports to Plugins Dir
run: mv dashboards-reports ../OpenSearch-Dashboards/plugins/${{ env.PLUGIN_NAME }}

- name: Add Chromium Binary to Reporting for Testing
run: |
cd ../OpenSearch-Dashboards/plugins/${{ env.PLUGIN_NAME }}
curl.exe -LO https://github.com/opensearch-project/dashboards-reports/releases/download/chromium-1.12.0.0/chromium-windows-x64.zip
Expand-Archive -Path 'chromium-windows-x64.zip'
Move-Item -Path "./chromium-windows-x64/.chromium" -Destination "./.chromium"
rd chromium-windows-x64.zip
rd chromium-windows-x64
- name: Checkout Plugin
uses: actions/checkout@v1
with:
path: OpenSearch-Dashboards/plugins/${{ env.PLUGIN_NAME }}

- name: OpenSearch Dashboards Plugin Bootstrap
uses: nick-invision/retry@v1
uses: nick-fields/retry@v1
with:
timeout_minutes: 30
max_attempts: 3
command: cd ../OpenSearch-Dashboards/plugins/${{ env.PLUGIN_NAME }} && yarn osd bootstrap
command: yarn osd bootstrap

- name: Test
uses: nick-invision/retry@v1
uses: nick-fields/retry@v1
with:
timeout_minutes: 30
max_attempts: 3
command: cd ../OpenSearch-Dashboards/plugins/${{ env.PLUGIN_NAME }} && yarn test
command: yarn test

- name: Build Artifact
run: |
cd ../OpenSearch-Dashboards/plugins/${{ env.PLUGIN_NAME }}
yarn build

cd build
mkdir -p ./windows-x64/opensearch-dashboards/${{ env.PLUGIN_NAME }}
mv ./${{ env.PLUGIN_NAME }}-*.zip ./windows-x64/${{ env.ARTIFACT_NAME }}-${{ env.OPENSEARCH_PLUGIN_VERSION }}-windows-x64.zip

cd windows-x64
curl.exe -LO https://github.com/opensearch-project/dashboards-reports/releases/download/chromium-1.12.0.0/chromium-windows-x64.zip
Expand-Archive -Path 'chromium-windows-x64.zip'
Move-Item -Path "./chromium-windows-x64/.chromium" -Destination "./opensearch-dashboards/${{ env.PLUGIN_NAME }}"
rd chromium-windows-x64.zip
rd chromium-windows-x64
Compress-Archive -Path "./${{ env.ARTIFACT_NAME }}-*.zip" -Destination "./opensearch-dashboards"
mv ./${{ env.ARTIFACT_NAME }}-*.zip ..
cd ..
mv ./build/*.zip ./build/${{ env.ARTIFACT_NAME }}-${{ env.OPENSEARCH_PLUGIN_VERSION }}.zip

- name: Upload Artifact For Windows
uses: actions/upload-artifact@v1
with:
name: dashboards-reports-windows-x64
path: ../OpenSearch-Dashboards/plugins/${{ env.PLUGIN_NAME }}/build/${{ env.ARTIFACT_NAME }}-${{ env.OPENSEARCH_PLUGIN_VERSION }}-windows-x64.zip
name: dashboards-reports-windows
path: ./build/${{ env.ARTIFACT_NAME }}-${{ env.OPENSEARCH_PLUGIN_VERSION }}.zip

macos-build:
runs-on: macos-latest
steps:
- name: Checkout Plugin
uses: actions/checkout@v1

- name: Checkout OpenSearch Dashboards
uses: actions/checkout@v1
with:
Expand All @@ -209,48 +146,32 @@ jobs:
registry-url: 'https://registry.npmjs.org'


- name: Move Dashboards Reports to Plugins Dir
run: mv dashboards-reports ../OpenSearch-Dashboards/plugins/${{ env.PLUGIN_NAME }}

- name: Add Chromium Binary to Reporting for Testing
run: |
cd ../OpenSearch-Dashboards/plugins/${{ env.PLUGIN_NAME }}
wget https://github.com/opendistro-for-elasticsearch/kibana-reports/releases/download/chromium-1.12.0.0/chromium-macos-x64.zip
unzip chromium-macos-x64.zip
rm chromium-macos-x64.zip
- name: Checkout Plugin
uses: actions/checkout@v1
with:
path: OpenSearch-Dashboards/plugins/${{ env.PLUGIN_NAME }}

- name: OpenSearch Dashboards Plugin Bootstrap
uses: nick-invision/retry@v1
uses: nick-fields/retry@v1
with:
timeout_minutes: 30
max_attempts: 3
command: cd ../OpenSearch-Dashboards/plugins/${{ env.PLUGIN_NAME }}; yarn osd bootstrap
command: yarn osd bootstrap

- name: Test
uses: nick-invision/retry@v1
uses: nick-fields/retry@v1
with:
timeout_minutes: 30
max_attempts: 3
command: cd ../OpenSearch-Dashboards/plugins/${{ env.PLUGIN_NAME }}; yarn test
command: yarn test

- name: Build Artifact
run: |
cd ../OpenSearch-Dashboards/plugins/${{ env.PLUGIN_NAME }}
yarn build
mv ./build/*.zip ./build/${{ env.ARTIFACT_NAME }}-${{ env.OPENSEARCH_PLUGIN_VERSION }}.zip

cd build
mkdir -p ./macos-x64/opensearch-dashboards/${{ env.PLUGIN_NAME }}
mv ./${{ env.PLUGIN_NAME }}-*.zip ./macos-x64/${{ env.ARTIFACT_NAME }}-${{ env.OPENSEARCH_PLUGIN_VERSION }}-macos-x64.zip

cd macos-x64
wget https://github.com/opensearch-project/dashboards-reports/releases/download/chromium-1.12.0.0/chromium-macos-x64.zip
unzip chromium-macos-x64.zip -d ./opensearch-dashboards/${{ env.PLUGIN_NAME }}
zip -ur ./${{ env.ARTIFACT_NAME }}-*.zip ./opensearch-dashboards
mv ./${{ env.ARTIFACT_NAME }}-*.zip ..
cd ..

- name: Upload Artifact For MacOS x64
- name: Upload Artifact For MacOS
uses: actions/upload-artifact@v1
with:
name: dashboards-reports-macosx-x64
path: ../OpenSearch-Dashboards/plugins/${{ env.PLUGIN_NAME }}/build/${{ env.ARTIFACT_NAME }}-${{ env.OPENSEARCH_PLUGIN_VERSION }}-macos-x64.zip
name: dashboards-reports-macosx
path: ./build/${{ env.ARTIFACT_NAME }}-${{ env.OPENSEARCH_PLUGIN_VERSION }}.zip
55 changes: 0 additions & 55 deletions .github/workflows/reports-scheduler-release-workflow.yml

This file was deleted.

Loading