Always override existing environment variables with the prefix OCTOCOV_
#1279
Workflow file for this run
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: build | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
jobs: | |
test: | |
name: Test | |
runs-on: ubuntu-latest | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
DEBUG: 1 | |
steps: | |
- name: Show rate limit | |
run: | | |
curl -sL -H "Authorization: token $GITHUB_TOKEN" -H "Accept: application/vnd.github.v3+json" https://api.github.com/rate_limit | |
- name: Check out source code | |
uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Set up Go | |
id: setup-go | |
uses: actions/setup-go@v4 | |
with: | |
go-version-file: go.mod | |
check-latest: true | |
- name: Run lint | |
uses: reviewdog/action-golangci-lint@v2 | |
with: | |
fail_on_error: true | |
- name: Run govulncheck | |
uses: golang/govulncheck-action@v1 | |
with: | |
go-version-input: '${{ steps.setup-go.outputs.go-version }}' | |
check-latest: true | |
go-package: ./... | |
fail-on-error: true | |
- name: Run gostyle | |
uses: k1LoW/gostyle-action@v1 | |
with: | |
go-version-input: '${{ steps.setup-go.outputs.go-version }}' | |
fail-on-error: true | |
- name: Run tests | |
run: make ci | |
- name: Run test_central | |
if: ${{ github.event_name == 'pull_request' }} | |
run: make test_central | |
- name: Run Trivy vulnerability scanner in repo mode | |
uses: aquasecurity/trivy-action@master | |
with: | |
scan-type: 'fs' | |
- name: Build octocov and run as a action | |
uses: ./testdata/actions/coverage | |
env: | |
MACKEREL_API_KEY: ${{ secrets.MACKEREL_API_KEY }} | |
OCTOCOV_CUSTOM_METRICS_BENCHMARK_1: ./testdata/custom_metrics/benchmark_1.json | |
OCTOCOV_CUSTOM_METRICS_BENCHMARK_0: ./testdata/custom_metrics/benchmark_0.json | |
- name: Show rate limit | |
run: | | |
curl -sL -H "Authorization: token $GITHUB_TOKEN" -H "Accept: application/vnd.github.v3+json" https://api.github.com/rate_limit | |
release-test-darwin: | |
name: Release assets test for maoOS | |
runs-on: macos-latest | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
- name: Check out source code | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version-file: go.mod | |
cache: true | |
- name: Setup | |
run: | | |
brew install goreleaser | |
- name: Release | |
run: | | |
goreleaser --config .goreleaser/darwin.yml --clean --snapshot --skip-publish | |
release-test-linux: | |
name: Release assets test for Linux | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up gcc-aarch64-linux-gnu | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y gcc-aarch64-linux-gnu | |
- name: Check out source code | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version-file: go.mod | |
cache: true | |
- name: Run GoReleaser | |
uses: goreleaser/goreleaser-action@v4 | |
with: | |
distribution: goreleaser | |
version: latest | |
args: release --config .goreleaser/linux.yml --clean --snapshot --skip-publish | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |