diff --git a/.github/workflows/release-workflow.yml b/.github/workflows/release-workflow.yml index ae4a05f5f..622384075 100644 --- a/.github/workflows/release-workflow.yml +++ b/.github/workflows/release-workflow.yml @@ -9,7 +9,7 @@ on: env: PLUGIN_NAME: trace-analytics-dashboards OPENSEARCH_VERSION: '1.0' - OPENSEARCH_PLUGIN_VERSION: 1.0.0.0-rc1 + OPENSEARCH_PLUGIN_VERSION: 1.0.0.0 jobs: diff --git a/.github/workflows/test-and-build-workflow.yml b/.github/workflows/test-and-build-workflow.yml index 98bf37739..d37b5145f 100644 --- a/.github/workflows/test-and-build-workflow.yml +++ b/.github/workflows/test-and-build-workflow.yml @@ -6,7 +6,7 @@ on: [pull_request, push] env: PLUGIN_NAME: trace-analytics-dashboards OPENSEARCH_VERSION: '1.0' - OPENSEARCH_PLUGIN_VERSION: 1.0.0.0-rc1 + OPENSEARCH_PLUGIN_VERSION: 1.0.0.0 jobs: @@ -16,35 +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: 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 + 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@v1 + uses: actions/checkout@v2 with: path: OpenSearch-Dashboards/plugins/trace-analytics - - name: Setup Node - uses: actions/setup-node@v1 - with: - node-version: '10.23.1' + - 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 +