Skip to content

Commit

Permalink
Update CI
Browse files Browse the repository at this point in the history
Signed-off-by: Joshua Li <[email protected]>

Fix CI

Signed-off-by: Joshua Li <[email protected]>
  • Loading branch information
joshuali925 committed Jun 30, 2021
1 parent e99b000 commit f2d3470
Showing 1 changed file with 28 additions and 8 deletions.
36 changes: 28 additions & 8 deletions .github/workflows/test-and-build-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,40 +16,60 @@ jobs:

steps:
- name: Checkout OpenSearch Dashboards
uses: actions/checkout@v1
uses: actions/checkout@v2
with:
repository: opensearch-project/Opensearch-Dashboards
repository: opensearch-project/OpenSearch-Dashboards
ref: ${{ env.OPENSEARCH_VERSION }}
path: OpenSearch-Dashboards
- name: Checkout Plugin
uses: actions/checkout@v1
with:
path: OpenSearch-Dashboards/plugins/trace-analytics

- name: Get node and yarn versions
id: versions_step
run: |
echo "::set-output name=node_version::$(node -p "(require('./OpenSearch-Dashboards/package.json').engines.node).match(/[.0-9]+/)[0]")"
echo "::set-output name=yarn_version::$(node -p "(require('./OpenSearch-Dashboards/package.json').engines.yarn).match(/[.0-9]+/)[0]")"
- name: Setup Node
- name: Setup node
uses: actions/setup-node@v1
with:
node-version: ${{ steps.versions_step.outputs.node_version }}
registry-url: 'https://registry.npmjs.org'

- name: Install correct yarn version for OpenSearch Dashboards
run: |
npm uninstall -g yarn
echo "Installing yarn ${{ steps.versions_step.outputs.yarn_version }}"
npm i -g yarn@${{ steps.versions_step.outputs.yarn_version }}
- name: Checkout Plugin
uses: actions/checkout@v2
with:
path: OpenSearch-Dashboards/plugins/trace-analytics

- name: Plugin Bootstrap
run: |
cd OpenSearch-Dashboards/plugins/trace-analytics
yarn osd bootstrap
- name: Test
run: |
cd OpenSearch-Dashboards/plugins/trace-analytics
yarn test --coverage
- name: Upload coverage
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
direcotry: ./OpenSearch-Dashboards/plugins/trace-analytics

- name: Build Artifact
run: |
cd OpenSearch-Dashboards/plugins/trace-analytics
yarn build
mv ./build/*.zip ./build/${{ env.PLUGIN_NAME }}-${{ env.OPENSEARCH_PLUGIN_VERSION }}.zip
- name: Upload Artifact
uses: actions/upload-artifact@v1
with:
name: trace-analytics
path: ./build
path: ./OpenSearch-Dashboards/plugins/trace-analytics/build

0 comments on commit f2d3470

Please sign in to comment.