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

[Improvement] Add CI check for PR #75

Open
danhuawang opened this issue Sep 19, 2024 · 2 comments · May be fixed by #111
Open

[Improvement] Add CI check for PR #75

danhuawang opened this issue Sep 19, 2024 · 2 comments · May be fixed by #111
Assignees

Comments

@danhuawang
Copy link
Contributor

danhuawang commented Sep 19, 2024

  1. Add workflow for github action. Template as following:

name: '[CI]'
on:
  pull_request:
    branches:
      - main
    paths:
      - '**.sh'
      - '**.xml'
      - 'helm-chart/**'
jobs:
  linter:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout code
        uses: actions/checkout@v4

      - name: Install xmllint
        run: |
          sudo apt-get update
          sudo apt-get install -y libxml2-utils

      - name: Install shfmt
        run: |
          curl -sSLo shfmt https://github.com/mvdan/sh/releases/download/v3.8.0/shfmt_v3.8.0_linux_amd64 &&
          chmod +x shfmt &&
          sudo mv shfmt /usr/local/bin/shfmt

      - name: Install Helm
        run: |
          curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash

      - name: Lint Shell Scripts
        run: |
          find . -name '*.sh' -print0 | xargs -0 shfmt -d -i 2

      - name: Check Helm Chart Templates
        run: |
          helm lint charts/*

      - name: Lint XML Files
        run: |
          find . -name '*.xml' -print0 | xargs -0 xmllint --noout

      - name: Checkout gravitino-playground
        uses: actions/checkout@v4

      - uses: KengoTODA/actions-setup-docker-compose@v1
        with:
          version: '2.14.2'

      - name: Deploy
        id: deploy
        timeout-minutes: 40
        run: |
          sudo curl -L https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 -o /usr/local/bin/yq
          sudo chmod +x /usr/local/bin/yq
          cd ${{ github.workspace }}/gravitino-playground
          nohup ./playground.sh docker start -y > /tmp/playground.log 2>&1 &
          # wait for gravitino trino ready to use
          i=0
          while [[ ! $(curl -k http://127.0.0.1:8090) || ! $(curl -k http://127.0.0.1:18080/v1/info) && $i -le 300 ]]; do
          sleep 5
          i=$(expr $i + 1)
          done
          docker ps
          if [[ $(curl -k http://127.0.0.1:8090) && $(curl -k http://127.0.0.1:18080/v1/info) ]]; then
            echo "gravitino and trino are ready to use"
          else
            echo "gravitino or trino not ready"
            exit 1
          fi

      - name: Test sql
        id: test-sql
        timeout-minutes: 40
        run: |
          cd ${{ github.workspace }}/gravitino-playground/test
          bash -x ./runSQLOnPlayground.sh
  1. In the github action , run some test cases for smoke test. attachment is an example of running SQL smoke cases.

example.tgz

@danhuawang danhuawang changed the title [improvement] Add CI check for PR [Improvement] Add CI check for PR Sep 19, 2024
@danhuawang
Copy link
Contributor Author

@unknowntpo Can you help implement this improvement ?

@unknowntpo
Copy link
Contributor

@danhuawang Sure.

@unknowntpo unknowntpo linked a pull request Dec 1, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants