From 7b70e9537e404f4dd0f6a83f6e06bce249bb72cc Mon Sep 17 00:00:00 2001 From: Samuel Attwood Date: Sat, 10 Jun 2023 03:02:38 -0400 Subject: [PATCH] Adding md path ignore. Formatting --- .github/workflows/coverage.yaml | 38 ++++++++++---------- .github/workflows/release.yaml | 63 +++++++++++++++++---------------- .github/workflows/test.yaml | 24 ++++++++----- Makefile | 8 ++--- 4 files changed, 71 insertions(+), 62 deletions(-) diff --git a/.github/workflows/coverage.yaml b/.github/workflows/coverage.yaml index 20df8c6..52d860c 100644 --- a/.github/workflows/coverage.yaml +++ b/.github/workflows/coverage.yaml @@ -3,31 +3,33 @@ on: push: branches: - main - - deps-update + paths-ignore: + - '**.md' + jobs: coverage: name: Test Coverage runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v3 - - name: Setup Go - uses: actions/setup-go@v4 - with: - go-version-file: go.mod + - name: Setup Go + uses: actions/setup-go@v4 + with: + go-version-file: go.mod - - name: Setup Goveralls - run: go install github.com/mattn/goveralls@v0.0.12 + - name: Setup Goveralls + run: go install github.com/mattn/goveralls@v0.0.12 - - name: Lint - uses: golangci/golangci-lint-action@v3 - with: - skip-pkg-cache: true + - name: Lint + uses: golangci/golangci-lint-action@v3 + with: + skip-pkg-cache: true - - name: Run Tests - run: make test-cov + - name: Run Tests + run: make test-cov - - name: Run Coveralls - run: goveralls -coverprofile=test.out,collector.out,exporter.out -service=github - env: - COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file + - name: Run Coveralls + run: goveralls -coverprofile=collector.out,exporter.out -service=github + env: + COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index dc34e80..dc51a1b 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -3,44 +3,45 @@ on: push: tags: - v[0-9]+.[0-9]+.[0-9]+ + jobs: release: runs-on: ubuntu-latest steps: - - name: Checkout code - uses: actions/checkout@v3 + - name: Checkout Code + uses: actions/checkout@v3 - - name: Setup Go - uses: actions/setup-go@v4 - with: - go-version-file: go.mod + - name: Setup Go + uses: actions/setup-go@v4 + with: + go-version-file: go.mod - - name: Setup QEMU - uses: docker/setup-qemu-action@v2 + - name: Setup QEMU + uses: docker/setup-qemu-action@v2 - - name: Setup Docker Buildx - id: buildx - uses: docker/setup-buildx-action@v2 + - name: Setup Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v2 - - name: Setup Docker Hub - uses: docker/login-action@v2 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_CLI_TOKEN }} + - name: Setup Docker Hub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_CLI_TOKEN }} - - name: Get Image Tags - id: tags - run: | - version=$(sed 's/^v//' <<< ${{ github.ref_name }}) - echo tags="latest,${version}" >> $GITHUB_OUTPUT + - name: Get Image Tags + id: tags + run: | + version=$(sed 's/^v//' <<< ${{ github.ref_name }}) + echo tags="latest,${version}" >> $GITHUB_OUTPUT - - name: Build and Push - uses: docker/bake-action@v3 - env: - TAGS: "${{ steps.tags.outputs.tags }}" - REGISTRY: "natsio" - with: - files: docker-bake.hcl - push: true - set: - goreleaser.args.GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} + - name: Build and Push + uses: docker/bake-action@v3 + env: + TAGS: "${{ steps.tags.outputs.tags }}" + REGISTRY: "natsio" + with: + files: docker-bake.hcl + push: true + set: + goreleaser.args.GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 00953e7..95b0e27 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -1,5 +1,11 @@ name: Test -on: [push,pull_request] +on: + push: + paths-ignore: + - '**.md' + pull_request: + paths-ignore: + - '**.md' jobs: test: @@ -8,13 +14,13 @@ jobs: os: [ubuntu-latest, macOS-latest, windows-latest] runs-on: ${{matrix.os}} steps: - - name: Checkout code - uses: actions/checkout@v3 + - name: Checkout Code + uses: actions/checkout@v3 - - name: Setup Go - uses: actions/setup-go@v4 - with: - go-version-file: go.mod + - name: Setup Go + uses: actions/setup-go@v4 + with: + go-version-file: go.mod - - name: Run tests - run: make test + - name: Run Tests + run: make test diff --git a/Makefile b/Makefile index e31de67..c7d0138 100644 --- a/Makefile +++ b/Makefile @@ -15,13 +15,13 @@ build: .PHONY: test test: - go test -race -count=1 -parallel=1 -v ./test/... - go test -race -count=1 -parallel=1 -v ./collector/... - go test -race -count=1 -parallel=1 -v ./exporter/... + go test -v -race -count=1 -parallel=1 ./test/... + go test -v -race -count=1 -parallel=1 ./collector/... + go test -v -race -count=1 -parallel=1 ./exporter/... .PHONY: test-cov test-cov: - go test -v -race -count=1 -parallel=1 -coverprofile=test.out ./test/... + go test -v -race -count=1 -parallel=1 ./test/... go test -v -race -count=1 -parallel=1 -coverprofile=collector.out ./collector/... go test -v -race -count=1 -parallel=1 -coverprofile=exporter.out ./exporter/...