Add plugin priority for plans and overrides (#19) #96
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: Quality Assurance | |
| "on": | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| types: | |
| - opened | |
| - synchronize | |
| - reopened | |
| - ready_for_review | |
| # Cancel prior runs on the same branch when a new one starts | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| test: | |
| if: github.event.pull_request.draft == false | |
| name: Test | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: stable | |
| - name: Run unit tests with race detector | |
| if: runner.os != 'Windows' | |
| run: | | |
| go test -race -v -coverprofile=coverage.out -coverpkg=./... ./... | |
| mkdir coverage | |
| go tool cover -func coverage.out -o coverage/coverage.out | |
| go tool cover -html coverage.out -o coverage/coverage.html | |
| - name: Run unit tests without race detector | |
| if: runner.os == 'Windows' | |
| run: | | |
| go test -v -cover -coverpkg=./... ./... | |
| - name: Test examples output | |
| run: go test -v -tags e2e -count=1 ./examples_test.go | |
| - uses: actions/upload-artifact@v7 | |
| if: ${{ runner.os == 'Linux' && github.event_name == 'push' && github.ref == 'refs/heads/main' }} | |
| with: | |
| name: coverage | |
| path: coverage | |
| overwrite: true | |
| lint: | |
| name: Lint | |
| if: github.event.pull_request.draft == false | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: stable | |
| - name: Run linters | |
| uses: golangci/golangci-lint-action@v9 | |
| with: | |
| version: v2.11.4 | |
| args: --tests=false --timeout=5m | |
| update-coverage: | |
| name: Update coverage report | |
| needs: test | |
| if: ${{ !cancelled() && needs.test.result == 'success' && github.event_name == 'push' && github.ref == 'refs/heads/main' }} | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/download-artifact@v8 | |
| with: | |
| name: coverage | |
| path: coverage | |
| - name: Generate badge and report | |
| run: | | |
| COVERAGE="$(grep total coverage/coverage.out | awk '{print $3}')" | |
| rm coverage/coverage.out | |
| curl -o coverage/coverage.svg "https://img.shields.io/badge/coverage-${COVERAGE}25-green" | |
| - name: Upload | |
| uses: JamesIves/github-pages-deploy-action@v4 | |
| with: | |
| folder: coverage |