Skip to content

Commit

Permalink
Adding md path ignore. Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelattwood committed Jun 27, 2023
1 parent 828a237 commit 7b70e95
Show file tree
Hide file tree
Showing 4 changed files with 71 additions and 62 deletions.
38 changes: 20 additions & 18 deletions .github/workflows/coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]
- name: Setup Goveralls
run: go install github.com/mattn/[email protected]

- 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 }}
- name: Run Coveralls
run: goveralls -coverprofile=collector.out,exporter.out -service=github
env:
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
63 changes: 32 additions & 31 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
24 changes: 15 additions & 9 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
name: Test
on: [push,pull_request]
on:
push:
paths-ignore:
- '**.md'
pull_request:
paths-ignore:
- '**.md'

jobs:
test:
Expand All @@ -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
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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/...

Expand Down

0 comments on commit 7b70e95

Please sign in to comment.