diff --git a/.github/workflows/package.yml b/.github/workflows/package.yml deleted file mode 100644 index b1f06fc..0000000 --- a/.github/workflows/package.yml +++ /dev/null @@ -1,82 +0,0 @@ -name: "Package Plugin" - -on: - push: - branches: - - main - pull_request: - branches: - - main - -jobs: - run: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - name: Setup packages - id: setup-packages - run: | - sudo apt-get update -y - sudo apt-get install -y zip zstd jq git - - - name: Setup Node.js environment - uses: actions/setup-node@v4.0.2 - with: - node-version-file: '.nvmrc' - - - name: Setup Go environment - uses: actions/setup-go@v5 - with: - go-version: "1.21" - - - name: Install yarn dependencies - run: yarn install - env: - NODE_OPTIONS: '--max_old_space_size=4096' - - - name: Build Frontend - run: yarn build - env: - NODE_OPTIONS: '--max_old_space_size=4096' - - - name: Build backend - uses: magefile/mage-action@v3 - with: - version: latest - args: buildAll - - - name: Get plugin metadata - id: metadata - run: | - sudo apt-get install jq - - export GRAFANA_PLUGIN_ID=$(cat dist/plugin.json | jq -r .id) - export GRAFANA_PLUGIN_VERSION=$(cat dist/plugin.json | jq -r .info.version) - export GRAFANA_PLUGIN_TYPE=$(cat dist/plugin.json | jq -r .type) - export GRAFANA_PLUGIN_ARTIFACT=${GRAFANA_PLUGIN_ID}-${GRAFANA_PLUGIN_VERSION}.zip - export GRAFANA_PLUGIN_ARTIFACT_SHA1SUM=${GRAFANA_PLUGIN_ARTIFACT}.sha1 - - echo "plugin-id=${GRAFANA_PLUGIN_ID}" >> $GITHUB_OUTPUT - echo "plugin-version=${GRAFANA_PLUGIN_VERSION}" >> $GITHUB_OUTPUT - echo "plugin-type=${GRAFANA_PLUGIN_TYPE}" >> $GITHUB_OUTPUT - echo "archive=${GRAFANA_PLUGIN_ARTIFACT}" >> $GITHUB_OUTPUT - echo "archive-sha1sum=${GRAFANA_PLUGIN_ARTIFACT_SHA1SUM}" >> $GITHUB_OUTPUT - - echo "github-tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT - shell: bash - - - name: Package plugin - id: package-plugin - run: | - mv dist ${{ steps.metadata.outputs.plugin-id }} - zip ${{ steps.metadata.outputs.archive }} ${{ steps.metadata.outputs.plugin-id }} -r - sha1sum ${{ steps.metadata.outputs.archive }} | cut -f1 -d' ' > ${{ steps.metadata.outputs.archive-sha1sum }} - shell: bash - - - name: Archive plugin build artifacts - uses: actions/upload-artifact@v4 - with: - name: grafana-questdb-datasource.zip - path: ${{ steps.metadata.outputs.archive }} - retention-days: 7 diff --git a/.github/workflows/pull-request-image.yml_disabled b/.github/workflows/pull-request-image.yml_disabled deleted file mode 100644 index bd78ae8..0000000 --- a/.github/workflows/pull-request-image.yml_disabled +++ /dev/null @@ -1,133 +0,0 @@ -#name: Create Docker image for local testing -# -#on: -# pull_request: -# types: [opened, reopened, synchronize] -# branches: -# - main -# -#permissions: -# pull-requests: write -# issues: write -# -#jobs: -# build: -# name: Build and archive plugin build artifacts -# runs-on: ubuntu-latest -# strategy: -# fail-fast: true -# -# steps: -# - uses: actions/checkout@v4 -# -# - name: Setup Node.js environment -# uses: actions/setup-node@v4.0.2 -# with: -# node-version-file: '.nvmrc' -# -# - name: Install Go environment -# uses: actions/setup-go@v5 -# with: -# go-version: 'stable' -# -# - name: Install yarn dependencies -# run: yarn install -# env: -# NODE_OPTIONS: '--max_old_space_size=4096' -# -# - name: Build -# run: go build -v ./... -# -# - name: Build Frontend -# run: yarn build -# env: -# NODE_OPTIONS: '--max_old_space_size=4096' -# -# - name: Archive plugin build artifacts -# uses: actions/upload-artifact@v4 -# with: -# name: plugin-dist -# path: | -# dist -# retention-days: 1 -# push_to_registry: -# name: Push Docker image to Docker Hub -# runs-on: ubuntu-latest -# needs: build -# steps: -# - name: Download plugin build artifacts -# uses: actions/download-artifact@v4 -# id: download -# with: -# name: plugin-dist -# -# - name: Generate Dockerfile -# shell: bash -# run: | -# echo "FROM grafana/grafana-oss:latest -# -# # Make it as simple as possible to access the grafana instance for development purposes -# # Do NOT enable these settings in a public facing / production grafana instance -# ENV GF_AUTH_ANONYMOUS_ORG_ROLE "Admin" -# ENV GF_AUTH_ANONYMOUS_ENABLED "true" -# ENV GF_AUTH_BASIC_ENABLED "false" -# -# # Set development mode so plugins can be loaded without the need to sign -# ENV GF_DEFAULT_APP_MODE "development" -# -# # TODO: Cleanup script should remove images from closed PRs using these labels -# LABEL gh-sha="${{ github.event.pull_request.head.sha }}" -# LABEL gh-repo="${{ github.event.repository.name }}" -# LABEL gh-pr-number="${{ github.event.number }}" -# -# # Copy plugin build artifacts into the image -# COPY . /var/lib/grafana/plugins/${{ github.event.repository.name }}/" > Dockerfile -# -# - name: Log in to Docker Hub -# uses: docker/login-action@v3 -# with: -# username: ${{ secrets.DOCKERHUB_USERNAME }} -# password: ${{ secrets.DOCKERHUB_TOKEN }} -# -# - name: Build and push Docker image -# uses: docker/build-push-action@v5 -# with: -# context: . -# file: ./Dockerfile -# push: true -# tags: grafana/plugin-builds:${{ github.event.pull_request.head.sha }}pre -# add_pr_comment: -# name: Add PR comment -# runs-on: ubuntu-latest -# needs: push_to_registry -# steps: -# - name: Find previous comment (if any) -# uses: peter-evans/find-comment@v2 -# id: fc -# with: -# issue-number: ${{ github.event.number }} -# body-includes: Use the following command to run this PR with Docker -# - name: Update comment on PR -# if: steps.fc.outputs.comment-id != '' -# uses: peter-evans/create-or-update-comment@v3 -# with: -# comment-id: ${{ steps.fc.outputs.comment-id }} -# edit-mode: replace -# issue-number: ${{ github.event.number }} -# body: | -# Use the following command to run this PR with Docker at http://localhost:3000: -# -# ``` -# docker run --rm -p 3000:3000 grafana/plugin-builds:${{ github.event.pull_request.head.sha }}pre -# ``` -# - name: Add comment to PR -# if: steps.fc.outputs.comment-id == '' -# uses: peter-evans/create-or-update-comment@v3 -# with: -# issue-number: ${{ github.event.number }} -# body: | -# Use the following command to run this PR with Docker at http://localhost:3000: -# -# ``` -# docker run --rm -p 3000:3000 grafana/plugin-builds:${{ github.event.pull_request.head.sha }}pre -# ``` diff --git a/.github/workflows/run-backend-tests.yml b/.github/workflows/run-backend-tests.yml deleted file mode 100644 index c54d235..0000000 --- a/.github/workflows/run-backend-tests.yml +++ /dev/null @@ -1,40 +0,0 @@ -name: run-backend-tests - -on: - push: - branches: - - main - pull_request: - branches: - - main - # build may start failing due to questdb change - schedule: - - cron: '0 9 1 * *' - -jobs: - run: - runs-on: ubuntu-latest - strategy: - fail-fast: true - matrix: - questdb_version: - - latest - #- nightly - questdb_name: - - 'questdb/questdb' - # - 'questdb/enterprise' - - steps: - - uses: actions/checkout@v4 - - - name: Install Go - uses: actions/setup-go@v5 - with: - go-version: '1.21' - - - name: Build - run: go build -v ./... - - - name: Run backend tests - run: QUESTDB_NAME=${{ matrix.questdb_name }} QUESTDB_VERSION=${{ matrix.questdb_version }} go test -v ./... - diff --git a/.github/workflows/run-frontend-tests.yml b/.github/workflows/run-frontend-tests.yml deleted file mode 100644 index 257924d..0000000 --- a/.github/workflows/run-frontend-tests.yml +++ /dev/null @@ -1,47 +0,0 @@ -name: run-frontend-tests - -on: - push: - branches: - - main - pull_request: - branches: - - main - -jobs: - run: - runs-on: ubuntu-latest - strategy: - fail-fast: true - - steps: - - uses: actions/checkout@v4 - - - name: Setup packages - id: setup-packages - run: | - sudo apt-get update -y - sudo apt-get install -y zip zstd jq git - - - name: Setup Node.js environment - uses: actions/setup-node@v4.0.2 - with: - node-version-file: '.nvmrc' - - - name: Install Go - uses: actions/setup-go@v5 - with: - go-version: '1.21' - - - name: Install yarn dependencies - run: yarn install - env: - NODE_OPTIONS: '--max_old_space_size=4096' - - - name: Build - run: go build -v ./... - - - name: Build Frontend - run: yarn build - env: - NODE_OPTIONS: '--max_old_space_size=4096' diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 79ab98c..b5af775 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -65,6 +65,7 @@ jobs: version: latest args: -v buildAll + - name: Get plugin metadata id: metadata run: |