name: Backend Unit Tests on: pull_request: paths-ignore: - 'docs/**' - '**/*.md' push: branches: - main - release-*.*.* paths-ignore: - 'docs/**' - '**/*.md' concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }} permissions: {} jobs: grafana: # Run this workflow only for PRs from forks; if it gets merged into `main` or `release-*`, # the `pr-backend-unit-tests-enterprise` workflow will run instead if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork == true name: Grafana runs-on: ubuntu-latest-8-cores continue-on-error: true permissions: contents: read id-token: write steps: - name: Checkout code uses: actions/checkout@v4 with: persist-credentials: false - name: Setup Go uses: actions/setup-go@v5 with: go-version-file: go.mod - name: Generate Go code run: make gen-go - name: Run unit tests run: make test-go-unit grafana-enterprise: # Run this workflow for non-PR events (like pushes to `main` or `release-*`) OR for internal PRs (PRs not from forks) if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork == false name: Grafana Enterprise runs-on: ubuntu-latest-8-cores permissions: contents: read id-token: write steps: - name: Checkout code uses: actions/checkout@v4 with: persist-credentials: false - name: Setup Go uses: actions/setup-go@v5 with: go-version-file: go.mod - name: Setup Enterprise uses: ./.github/actions/setup-enterprise with: github-app-name: 'grafana-ci-bot' - name: Generate Go code run: make gen-go - name: Run unit tests run: make test-go-unit