air-sensors

Air Quality Sensor library
git clone https://www.brianlane.com/git/air-sensors
Log | Files | Refs | README | LICENSE

commit 20e61875ce6f9ad044e7a034c516b8e255f546da
parent ffa038643c4026950e4cd4d5be70aede7ca32012
Author: Brian C. Lane <bcl@brianlane.com>
Date:   Fri, 28 May 2021 15:08:47 -0700

github: Add workflow for coverage and linting

Diffstat:
A.github/workflows/coverage.yml | 29+++++++++++++++++++++++++++++
M.github/workflows/go.yml | 8++++----
A.github/workflows/golangci-lint.yml | 16++++++++++++++++
A.github/workflows/lint.yml | 21+++++++++++++++++++++
4 files changed, 70 insertions(+), 4 deletions(-)

diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml @@ -0,0 +1,29 @@ +name: Coverage +on: + push: + branches: [main] + pull_request: + branches: [main] +jobs: + test: + name: Test with Coverage + runs-on: ubuntu-latest + steps: + - name: Set up Go + uses: actions/setup-go@v1 + with: + go-version: '1.15' + - name: Check out code + uses: actions/checkout@v2 + - name: Install dependencies + run: | + go mod download + - name: Run Unit tests + run: | + go test -race -covermode atomic -coverprofile=profile.cov ./... + - name: Send coverage + env: + COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + GO111MODULE=off go get github.com/mattn/goveralls + $(go env GOPATH)/bin/goveralls -coverprofile=profile.cov -service=github diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml @@ -18,8 +18,8 @@ jobs: with: go-version: 1.15 - - name: Build - run: go build -v ./... + - name: Build run-pmsa003i + run: go build -v ./cmd/run-pmsa003i - - name: Test - run: go test -v ./... + - name: Build run-sgp30 + run: go build -v ./cmd/run-sgp30 diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml @@ -0,0 +1,16 @@ +name: golangci-lint +on: + push: + branches: [main] + pull_request: + branches: [main] +jobs: + golangci: + name: lint + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: golangci-lint + uses: golangci/golangci-lint-action@v2 + with: + version: latest diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml @@ -0,0 +1,21 @@ +name: golint +on: + push: + branches: [main] + pull_request: + branches: [main] +jobs: + test: + name: Run golint + runs-on: ubuntu-latest + steps: + - name: Set up Go + uses: actions/setup-go@v1 + with: + go-version: '1.15' + - name: Check out code + uses: actions/checkout@v2 + - name: Install golint + run: go get golang.org/x/lint/golint + - name: Run golint + run: $(go env GOPATH)/bin/golint ./...