Add alerting to the plugin #83
This file contains 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: CI | |
env: | |
NO_BUILD_IMAGE: '1' | |
IMAGE_REPO: ghcr.io/meln5674/grafana-mongodb-community-plugin | |
IMAGE_TAG: github-actions | |
on: | |
push: | |
branches: '**' | |
tags: '**' | |
pull_request: | |
branches: '**' | |
tags: '**' | |
workflow_dispatch: {} | |
jobs: | |
ci: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: true | |
- name: Get yarn cache directory path | |
id: yarn-cache-dir-path | |
run: echo "::set-output name=dir::$(yarn cache dir)" | |
- name: Get go cache directory path | |
id: gopath-dir-path | |
run: echo "::set-output name=dir::$(echo ~/go)" | |
- name: Cache yarn cache | |
uses: actions/cache/restore@v3 | |
id: restore-yarn-cache | |
with: | |
path: ${{ steps.yarn-cache-dir-path.outputs.dir }} | |
key: ${{ runner.os }}-yarn | |
restore-keys: | | |
${{ runner.os }}-yarn | |
- name: Cache gopath | |
uses: actions/cache/restore@v3 | |
id: restore-gopath | |
with: | |
path: ${{ steps.gopath-dir-path.outputs.dir }} | |
key: ${{ runner.os }}-go | |
restore-keys: | | |
${{ runner.os }}-go | |
- name: Install Dependencies | |
id: install-dependencies | |
run: | | |
export GOPATH=~/go | |
mkdir -p "${GOPATH}" | |
./build-env.sh yarn deps | |
- name: Cache yarn cache | |
uses: actions/cache/save@v3 | |
id: cache-yarn-cache | |
with: | |
path: ${{ steps.yarn-cache-dir-path.outputs.dir }} | |
key: ${{ runner.os }}-yarn | |
restore-keys: | | |
${{ runner.os }}-yarn | |
- name: Cache gopath | |
uses: actions/cache/save@v3 | |
id: cache-gopath | |
with: | |
path: ${{ steps.gopath-dir-path.outputs.dir }} | |
key: ${{ runner.os }}-go | |
restore-keys: | | |
${{ runner.os }}-go | |
- name: Lint | |
id: lint | |
run: | | |
export GOPATH=~/go | |
./build-env.sh yarn lint | |
- name: Build Frontend | |
id: build-frontend | |
run: | | |
export GOPATH=~/go | |
./build-env.sh yarn build | |
- name: Run Unit Tests | |
id: unit-tests | |
run: | | |
export GOPATH=~/go | |
./build-env.sh yarn test-backend | |
- name: Build Backend | |
id: build-backend | |
run: | | |
export GOPATH=~/go | |
./build-env.sh yarn backend | |
- name: Build Plugin Zip | |
id: build-plugin-zip | |
run: | | |
export GOPATH=~/go | |
./build-env.sh yarn plugin | |
- name: Run Integration Tests | |
id: run-integration-tests | |
run: | | |
helm dependency update integration-test/bitnami-charts/bitnami/mongodb | |
export GOPATH=~/go | |
./build-env.sh yarn integration-test | |
- name: Create Release | |
uses: "marvinpinto/action-automatic-releases@latest" | |
if: contains(github.ref, 'tags/v') | |
with: | |
repo_token: "${{ secrets.GITHUB_TOKEN }}" | |
# automatic_release_tag: "${{ github.ref }}" | |
prerelease: true | |
title: "${{ github.tag }}" | |
files: | | |
meln5674-mongodb-community.zip |