forked from taiidani/terraform-provider-jenkins
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add staticcheck linter (taiidani#23)
* Add staticcheck linter * Update acceptance test * Also run acceptance tests on master
- Loading branch information
Showing
6 changed files
with
68 additions
and
60 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,43 @@ | ||
name: Acceptance Tests | ||
|
||
on: pull_request | ||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- main | ||
- master | ||
|
||
jobs: | ||
|
||
build: | ||
name: Build | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
- name: Set up Go 1.x | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: ^1.14 | ||
id: go | ||
|
||
- name: Check out code into the Go module directory | ||
uses: actions/checkout@v2 | ||
|
||
- run: go mod download | ||
|
||
- name: Set up services | ||
env: | ||
COMPOSE_FILE: ./example/docker-compose.yml | ||
run: | | ||
docker-compose build | ||
docker-compose up -d --force-recreate jenkins | ||
while [ "$(docker inspect jenkins-provider-acc --format '{{ .State.Health.Status }}')" != "healthy" ]; do echo "Waiting for Jenkins to start..."; sleep 3; done | ||
- name: Run Acceptance Tests | ||
env: | ||
TF_ACC: "1" | ||
JENKINS_URL: "http://localhost:8080" | ||
JENKINS_USERNAME: "admin" | ||
JENKINS_PASSWORD: "admin" | ||
run: go test -v -covermode=atomic -coverprofile=coverage.txt ./... | ||
|
||
- name: Send coverage to Codecov | ||
run: bash <(curl -s https://codecov.io/bash) -Z -f coverage.txt -F acceptance | ||
- name: Set up Go 1.x | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: ^1.14 | ||
id: go | ||
|
||
- name: Check out code into the Go module directory | ||
uses: actions/checkout@v2 | ||
|
||
- run: go mod download | ||
|
||
- name: Set up services | ||
env: | ||
COMPOSE_FILE: ./example/docker-compose.yml | ||
run: | | ||
docker-compose build | ||
docker-compose up -d --force-recreate jenkins | ||
while [ "$(docker inspect jenkins-provider-acc --format '{{ .State.Health.Status }}')" != "healthy" ]; do echo "Waiting for Jenkins to start..."; sleep 3; done | ||
- name: Run Acceptance Tests | ||
env: | ||
TF_ACC: "1" | ||
JENKINS_URL: "http://localhost:8080" | ||
JENKINS_USERNAME: "admin" | ||
JENKINS_PASSWORD: "admin" | ||
run: go test -v -covermode=atomic -coverprofile=coverage.txt ./... | ||
|
||
- name: Send coverage to Codecov | ||
run: bash <(curl -s https://codecov.io/bash) -Z -f coverage.txt -F acceptance |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,29 @@ | ||
name: Unit Tests | ||
|
||
on: [ push ] | ||
on: [push] | ||
|
||
jobs: | ||
|
||
build: | ||
name: Build | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
- name: Set up Go 1.x | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: ^1.14 | ||
id: go | ||
|
||
- name: Check out code into the Go module directory | ||
uses: actions/checkout@v2 | ||
|
||
- run: go mod download | ||
- run: go vet ./... | ||
|
||
- name: Test | ||
run: go test -race -covermode=atomic -coverprofile=coverage.txt ./... | ||
|
||
- name: Send coverage to Codecov | ||
run: bash <(curl -s https://codecov.io/bash) -Z -f coverage.txt -F unit | ||
- name: Set up Go 1.x | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: ^1.15 | ||
id: go | ||
|
||
- name: Check out code into the Go module directory | ||
uses: actions/checkout@v2 | ||
|
||
- run: go mod download | ||
- run: go vet ./... | ||
- run: | | ||
go get honnef.co/go/tools/cmd/staticcheck | ||
staticcheck -tests ./... | ||
- name: Test | ||
run: go test -race -covermode=atomic -coverprofile=coverage.txt ./... | ||
|
||
- name: Send coverage to Codecov | ||
run: bash <(curl -s https://codecov.io/bash) -Z -f coverage.txt -F unit |
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
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
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
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