Merge branch 'meshery:master' into master #5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Meshery UI and Server | |
| on: | |
| pull_request_target: | |
| types: [opened, synchronize, reopened] | |
| branches: | |
| - "master" | |
| paths-ignore: | |
| - "docs/**" | |
| - "mesheryctl/**" | |
| - "*.md" | |
| - "*.github/**" | |
| - "Makefile" | |
| push: | |
| branches: | |
| - "master" | |
| paths-ignore: | |
| - "docs/**" | |
| - "*.md" | |
| - "*.github/**" | |
| permissions: read-all | |
| jobs: | |
| ui-build: | |
| name: UI build | |
| if: github.repository == 'meshery/meshery' | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Check out code | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| ref: ${{ github.event_name == 'pull_request_target' && github.event.pull_request.head.sha || '' }} | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: 20 | |
| cache: "npm" | |
| cache-dependency-path: "**/package-lock.json" | |
| - name: Build meshery-ui and provider-ui | |
| run: | | |
| make ui-build | |
| - name: Upload meshery-ui artifacts | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: meshery-ui | |
| retention-days: 30 | |
| path: /home/runner/work/meshery/meshery/ui/out | |
| - name: Upload provider-ui artifacts | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: provider-ui | |
| retention-days: 30 | |
| path: /home/runner/work/meshery/meshery/provider-ui/out | |
| tests-ui-e2e: | |
| needs: [ui-build] | |
| name: UI end-to-end tests | |
| environment: staging-playground | |
| if: github.repository == 'meshery/meshery' | |
| runs-on: ubuntu-24.04 | |
| timeout-minutes: 45 | |
| steps: | |
| - name: Check out code | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| ref: ${{ github.event_name == 'pull_request_target' && github.event.pull_request.head.sha || '' }} | |
| - name: Create k8s Kind Cluster | |
| uses: helm/[email protected] | |
| with: | |
| cluster_name: "kind-cluster" | |
| - name: Setup Go | |
| uses: actions/setup-go@master | |
| with: | |
| go-version: "1.25" | |
| cache-dependency-path: "**/*.sum" | |
| cache: true | |
| - name: Setup node | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: 20 | |
| cache: "npm" | |
| cache-dependency-path: "**/package-lock.json" | |
| - name: Download meshery-ui artifacts | |
| uses: actions/download-artifact@v7 | |
| with: | |
| name: meshery-ui | |
| path: /home/runner/work/meshery/meshery/ui/out | |
| - name: Download provider-ui artifacts | |
| uses: actions/download-artifact@v7 | |
| with: | |
| name: provider-ui | |
| path: /home/runner/work/meshery/meshery/provider-ui/out | |
| - name: Run Meshery UI and Server | |
| run: | | |
| make server & | |
| sleep 90 | |
| - name: Install Playwright | |
| run: make ui-setup-ci | |
| - name: Install Playwright Browsers | |
| run: make ui-test-setup | |
| - name: Run Playwright End-to-End Tests | |
| env: | |
| MESHERY_SERVER_URL: "http://localhost:9081" | |
| REMOTE_PROVIDER_URL: "https://cloud.layer5.io" | |
| REMOTE_PROVIDER_USER_EMAIL: ${{ secrets.REMOTE_PROVIDER_TEST_USER_EMAIL }} | |
| REMOTE_PROVIDER_USER_PASSWORD: ${{ secrets.REMOTE_PROVIDER_TEST_USER_PASS }} | |
| PROVIDER_TOKEN: ${{ secrets.REMOTE_PROVIDER_TEST_USER_TOKEN }} | |
| run: make ui-test-e2e-ci | |
| - name: Save PR metadata | |
| if: ${{ !cancelled() && github.event_name == 'pull_request_target' }} | |
| run: | | |
| mkdir -p ./pr | |
| echo "${{ github.event.number }}" > ./pr/number | |
| echo "${{ github.event.pull_request.head.sha }}" > ./pr/sha | |
| - name: Checkout QA | |
| uses: actions/checkout@v6 | |
| # run only for pushes to master | |
| if: ${{ !cancelled() && github.event_name == 'push' }} | |
| with: | |
| repository: meshery/qa | |
| path: ./qa | |
| file_pattern: meshery-results | |
| token: ${{ secrets.GH_ACCESS_TOKEN }} | |
| - name: Sync results with qa | |
| if: ${{ !cancelled() && github.event_name == 'push' }} | |
| working-directory: qa | |
| run: | | |
| ls | |
| ls .. | |
| make meshery-results-sync MESHERY_RESULTS_PATH=../ui/allure-results | |
| - name: Commit & push academy to qa | |
| if: ${{ !cancelled() && github.event_name == 'push' }} | |
| uses: stefanzweifel/git-auto-commit-action@v7 | |
| with: | |
| commit_message: "[Meshery] Sync Meshery E2E Test Results - ${GITHUB_SHA}" | |
| commit_options: "--signoff" | |
| repository: qa | |
| commit_user_name: meshery-ci | |
| commit_user_email: [email protected] | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }} | |
| - name: Upload Test Report | |
| if: ${{ !cancelled() }} | |
| uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6 | |
| with: | |
| name: e2e-test-reporter | |
| path: | | |
| ui/test-report.md | |
| pr/ | |
| retention-days: 14 | |
| - name: Upload Playwright Trace | |
| if: ${{ !cancelled() }} | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: playwright-traces | |
| path: ui/test-results/ | |
| retention-days: 14 | |
| - name: Upload Playwright HTML Report | |
| if: ${{ !cancelled() }} | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: playwright-report | |
| path: ui/playwright-report/ | |
| retention-days: 14 | |
| docker-build-test: | |
| name: Docker build | |
| if: github.repository == 'meshery/meshery' | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Check out code | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Free disk space | |
| run: | | |
| sudo rm -rf /usr/share/dotnet | |
| sudo rm -rf /usr/local/lib/android | |
| sudo rm -rf /opt/ghc | |
| sudo rm -rf /opt/hostedtoolcache | |
| - name: Docker edge build & tag | |
| if: startsWith(github.ref, 'refs/tags/') != true && success() | |
| env: | |
| RELEASE_CHANNEL: "edge" | |
| run: | | |
| DOCKER_BUILDKIT=1 docker build -f install/docker/Dockerfile --no-cache -t meshery:edge-latest --build-arg TOKEN=test --build-arg GIT_COMMITSHA=${GITHUB_SHA::8} --build-arg RELEASE_CHANNEL=${RELEASE_CHANNEL} . | |
| docker tag meshery:edge-latest meshery:edge-${GITHUB_SHA::8} | |
| - name: Docker edge push | |
| if: github.event_name != 'pull_request' && github.event_name != 'workflow_dispatch' && startsWith(github.ref, 'refs/tags/') && success() | |
| run: | | |
| docker push ${{ secrets.IMAGE_NAME }}:edge-latest | |
| docker push ${{ secrets.IMAGE_NAME }}:edge-${GITHUB_REF/refs\/tags\//} | |
| docker push ${{ secrets.IMAGE_NAME }}:edge-${GITHUB_SHA::8} | |
| - name: Docker Hub Description | |
| if: github.event_name != 'pull_request' && github.event_name != 'workflow_dispatch' && startsWith(github.ref, 'refs/tags/') && success() | |
| uses: peter-evans/dockerhub-description@v5 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_PASSWORD }} | |
| repository: ${{ secrets.IMAGE_NAME }} | |
| # validate the swagger docs | |
| swaggerci: | |
| if: github.repository == 'meshery/meshery' | |
| name: swagger-docs | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Check if handlers were modified | |
| uses: dorny/paths-filter@v3 | |
| id: changes | |
| with: | |
| filters: | | |
| modified: | |
| - added|modified: "handlers/**" | |
| - name: Setup go-swagger | |
| if: steps.changes.outputs.modified == 'true' | |
| uses: minchao/setup-go-swagger@v1 | |
| with: | |
| version: v0.26.1 | |
| - name: swagger-spec | |
| if: steps.changes.outputs.modified == 'true' | |
| run: swagger generate spec -o ./server/helpers/swagger.yaml --scan-models | |
| - name: swagger-docs | |
| if: steps.changes.outputs.modified == 'true' | |
| run: swagger generate spec -o ./docs/_data/swagger.yml --scan-models && swagger flatten ./docs/_data/swagger.yml -o ./docs/_data/swagger.yml --with-expand --format=yaml | |
| # validate graphQL schema | |
| graphql_validate: | |
| name: Validate GraphQL schema | |
| if: github.repository == 'meshery/meshery' | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Check out code | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Check if schema was modified | |
| uses: dorny/paths-filter@v3 | |
| id: filter | |
| with: | |
| filters: | | |
| modified: | |
| - added|modified: 'server/internal/graphql/schema/schema.graphql' | |
| - name: Set up Ruby | |
| if: steps.filter.outputs.modified == 'true' | |
| uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: 3.2.6 | |
| bundler-cache: true | |
| - name: graphql-docs | |
| if: steps.filter.outputs.modified == 'true' | |
| run: | | |
| cd docs | |
| bundle install | |
| bundle exec rake graphql:compile_docs | |
| # Run Rego policy tests | |
| rego-tests: | |
| name: Rego Policy Tests | |
| if: >- | |
| github.repository == 'meshery/meshery' && ( | |
| ( | |
| github.event_name == 'push' && | |
| ( | |
| contains(toJson(github.event.commits), '.rego') || | |
| contains(toJson(github.event.commits), 'server/policies/') || | |
| contains(toJson(github.event.commits), '.github/workflows/rego-lint-and-test.yml') | |
| ) | |
| ) || | |
| ( | |
| github.event_name == 'pull_request_target' && | |
| ( | |
| contains(toJson(github.event.pull_request), '.rego') || | |
| contains(toJson(github.event.pull_request), 'server/policies/') || | |
| contains(toJson(github.event.pull_request), '.github/workflows/rego-lint-and-test.yml') | |
| ) | |
| ) | |
| ) | |
| uses: ./.github/workflows/rego-lint-and-test.yml | |
| permissions: | |
| contents: write | |
| pull-requests: write |