diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1be2af5d8..891883ae3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,43 +7,37 @@ on: pull_request: jobs: - build: + build_lint_test: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 + - name: Setup go uses: actions/setup-go@v5 with: go-version-file: go.mod + - name: Setup Mage uses: magefile/mage-action@v3 with: install-only: true + - name: Install test dependencies + run: | + sudo apt update + sudo apt install -y gcc + + - name: Setup CI Linter + run: curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.54.2 + - name: Build run: | mage -v build - test: - runs-on: ubuntu-latest - needs: build - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Setup go - uses: actions/setup-go@v5 - with: - go-version-file: go.mod - - name: Install dependencies + - name: Lint run: | - sudo apt update - sudo apt install -y gcc - - - name: Setup Mage - uses: magefile/mage-action@v3 - with: - install-only: true + mage -v lint - name: Test run: | diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml deleted file mode 100644 index f944beb25..000000000 --- a/.github/workflows/lint.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: golangci-lint -on: - push: - branches: - - main - pull_request: - -permissions: - contents: read - -jobs: - golangci: - name: lint - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-go@v5 - with: - go-version: stable - - name: golangci-lint - uses: golangci/golangci-lint-action@v6 - with: - version: v1.54.2 diff --git a/.remove-drone.yml b/.remove-drone.yml new file mode 100644 index 000000000..59fad3abe --- /dev/null +++ b/.remove-drone.yml @@ -0,0 +1,73 @@ +--- +# This file must be signed. You can do so with the `mage drone` command + +kind: pipeline +type: docker +name: main + +platform: + os: linux + arch: amd64 + +trigger: + branch: main + event: + - push + +steps: + - name: build + image: grafana/grafana-plugin-ci:1.9.5 + commands: + - mage -v build + + - name: lint + image: grafana/grafana-plugin-ci:1.9.5 + commands: + - mage -v lint + + - name: test + image: grafana/grafana-plugin-ci:1.9.5 + commands: + # -race requires cgo + a C compiler + - apt update + - apt install -y gcc + - mage -v testRace + environment: + CGO_ENABLED: "1" +--- +kind: pipeline +type: docker +name: pr + +platform: + os: linux + arch: amd64 + +trigger: + event: + # - pull_request + +steps: + - name: build + image: grafana/grafana-plugin-ci:1.9.5 + commands: + - mage -v build + + - name: lint + image: grafana/grafana-plugin-ci:1.9.5 + commands: + - mage -v lint + + - name: test + image: grafana/grafana-plugin-ci:1.9.5 + commands: + # -race requires cgo + a C compiler + - apt update + - apt install -y gcc + - mage -v testRace + environment: + CGO_ENABLED: "1" + +--- +kind: signature +hmac: cee688a6f8ed3ecb1ddd384e349a6556d28b23b298057d8fa02da37ab50b0ba7