diff --git a/.github/workflows/dco.yml b/.github/workflows/dco.yml deleted file mode 100644 index cf30ea8..0000000 --- a/.github/workflows/dco.yml +++ /dev/null @@ -1,18 +0,0 @@ -name: Developer Certificate of Origin Check - -on: [pull_request] - -jobs: - check: - runs-on: ubuntu-latest - - steps: - - name: Get PR Commits - id: 'get-pr-commits' - uses: tim-actions/get-pr-commits@v1.1.0 - with: - token: ${{ secrets.GITHUB_TOKEN }} - - name: DCO Check - uses: tim-actions/dco@v1.1.0 - with: - commits: ${{ steps.get-pr-commits.outputs.commits }} diff --git a/.github/workflows/release-workflow.yml b/.github/workflows/release-workflow.yml deleted file mode 100644 index 0ee3851..0000000 --- a/.github/workflows/release-workflow.yml +++ /dev/null @@ -1,71 +0,0 @@ - -name: Release Gantt Chart Artifacts - -on: - push: - tags: - - 'v*' - -env: - PLUGIN_NAME: gantt-chart-dashboards - OPENSEARCH_VERSION: '1.0' - OPENSEARCH_PLUGIN_VERSION: 1.0.0.0 - -jobs: - - build: - - runs-on: ubuntu-latest - - steps: - - - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v1 - with: - aws-access-key-id: ${{ secrets.AWS_STAGING_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.AWS_STAGING_SECRET_ACCESS_KEY }} - aws-region: us-east-1 - - - name: Checkout Plugin - uses: actions/checkout@v1 - - - name: Checkout OpenSearch Dashboards - uses: actions/checkout@v1 - with: - repository: opensearch-project/Opensearch-Dashboards - ref: ${{ env.OPENSEARCH_VERSION }} - path: dashboards-visualizations/OpenSearch-Dashboards - - - name: Setup Node - uses: actions/setup-node@v1 - with: - node-version: '10.23.1' - - - name: Move Gantt Chart to Plugins Dir - run: | - mv gantt-chart OpenSearch-Dashboards/plugins - - - name: Plugin Bootstrap - run: | - cd OpenSearch-Dashboards/plugins/gantt-chart - yarn osd bootstrap - - - name: Build Artifact - run: | - cd OpenSearch-Dashboards/plugins/gantt-chart - yarn build - mv ./build/*.zip ./build/${{ env.PLUGIN_NAME }}-${{ env.OPENSEARCH_PLUGIN_VERSION }}.zip - - - name: Upload to S3 - run: | - cd OpenSearch-Dashboards/plugins/gantt-chart - artifact=`ls ./build/*.zip` - - # inject build number before the suffix - zip_outfile=`basename ${artifact%.zip}-build-${GITHUB_RUN_NUMBER}.zip` - - # TODO update s3 bucket - s3_prefix="s3://staging.artifacts.opendistroforelasticsearch.amazon.com/snapshots/kibana-plugins/gantt-chart/" - - echo "Copying ${artifact} to ${s3_prefix}${zip_outfile}" - aws s3 cp --quiet $artifact ${s3_prefix}${zip_outfile} diff --git a/.github/workflows/test-and-build-workflow.yml b/.github/workflows/test-and-build-workflow.yml index 95367d7..6e8ebe1 100644 --- a/.github/workflows/test-and-build-workflow.yml +++ b/.github/workflows/test-and-build-workflow.yml @@ -9,10 +9,20 @@ env: OPENSEARCH_PLUGIN_VERSION: 2.10.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 @@ -25,36 +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: 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 @@ -64,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