Skip to content

Commit

Permalink
Onboard jenkins prod docker images to github actions (#287)
Browse files Browse the repository at this point in the history
* Onboard jenkins prod docker images to github actions

Signed-off-by: Peter Zhu <[email protected]>

* Add more

Signed-off-by: Peter Zhu <[email protected]>

* Add more

Signed-off-by: Peter Zhu <[email protected]>

---------

Signed-off-by: Peter Zhu <[email protected]>
  • Loading branch information
peterzhuamazon authored Oct 31, 2023
1 parent 37a3545 commit d2d3de0
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 121 deletions.
18 changes: 0 additions & 18 deletions .github/workflows/dco.yml

This file was deleted.

71 changes: 0 additions & 71 deletions .github/workflows/release-workflow.yml

This file was deleted.

51 changes: 19 additions & 32 deletions .github/workflows/test-and-build-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,20 @@ env:
OPENSEARCH_PLUGIN_VERSION: 3.0.0.0

jobs:
Get-CI-Image-Tag:
uses: opensearch-project/opensearch-build/.github/workflows/get-ci-image-tag.yml@main
with:
product: opensearch-dashboards

linux-build:

needs: Get-CI-Image-Tag
runs-on: ubuntu-latest
container:
# using the same image which is used by opensearch-build team to build the OpenSearch Distribution
# this image tag is subject to change as more dependencies and updates will arrive over time
image: ${{ needs.Get-CI-Image-Tag.outputs.ci-image-version-linux }}
# need to switch to root so that github actions can install runner binary on container without permission issues.
options: --user root

steps:
- name: Checkout Plugin
Expand All @@ -25,41 +35,17 @@ jobs:
ref: ${{ env.OPENSEARCH_VERSION }}
path: dashboards-visualizations/OpenSearch-Dashboards

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version-file: './dashboards-visualizations/OpenSearch-Dashboards/.nvmrc'
registry-url: 'https://registry.npmjs.org'

- name: Install Yarn
# Need to use bash to avoid having a windows/linux specific step
shell: bash
run: |
YARN_VERSION=$(node -p "require('./dashboards-visualizations/OpenSearch-Dashboards/package.json').engines.yarn")
echo "Installing yarn@$YARN_VERSION"
npm i -g yarn@$YARN_VERSION
- run: node -v
- run: yarn -v

- name: Move Gantt Chart to Plugins Dir
run: |
mv gantt-chart ./dashboards-visualizations/OpenSearch-Dashboards/plugins
- name: Plugin Bootstrap
- name: Plugin Bootstrap / stylelint / test
run: |
cd ./dashboards-visualizations/OpenSearch-Dashboards/plugins/gantt-chart
yarn osd bootstrap
- name: Run Stylelint
run: |
cd ./dashboards-visualizations/OpenSearch-Dashboards/plugins/gantt-chart
yarn lint:style
- name: Test
run: |
cd ./dashboards-visualizations/OpenSearch-Dashboards/plugins/gantt-chart
yarn test --coverage
chown -R 1000:1000 `pwd`
cd dashboards-visualizations/OpenSearch-Dashboards/
su `id -un 1000` -c "source $NVM_DIR/nvm.sh && nvm use && node -v && yarn -v &&
cd ./plugins/gantt-chart &&
whoami && yarn osd bootstrap && yarn lint:style && yarn test --coverage"
- name: Upload coverage
uses: codecov/codecov-action@v1
Expand All @@ -69,8 +55,9 @@ jobs:

- name: Build Artifact
run: |
chown -R 1000:1000 `pwd`
cd ./dashboards-visualizations/OpenSearch-Dashboards/plugins/gantt-chart
yarn build
su `id -un 1000` -c "source $NVM_DIR/nvm.sh && nvm use && node -v && yarn -v && yarn build"
mv ./build/*.zip ./build/${{ env.PLUGIN_NAME }}-${{ env.OPENSEARCH_PLUGIN_VERSION }}.zip
- name: Upload Artifact
Expand Down

0 comments on commit d2d3de0

Please sign in to comment.