Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small CI cleanup #1048

Merged
merged 6 commits into from
Jan 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
name: GitHub Actions CI

on: [push, pull_request]
on:
push:
branches: [main]
pull_request: {}

jobs:
ci:
runs-on: ubuntu-latest
env:
GOFLAGS: "-mod=vendor"
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: '1.13'
go-version: '1.17.6'
- run: make tools
- run: make lint
- run: make test
- run: make website-lint
- run: make build
- run: make test
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ website/node_modules
*.iml
*.tfvars
.vscode/
testdata/

website/vendor

Expand Down
10 changes: 3 additions & 7 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,13 +156,7 @@ $ $GOPATH/bin/terraform-provider-github
...
```

In order to test the provider, you can simply run `make test`.

```sh
$ make test
```

In order to run the full suite of Acceptance tests, run `make testacc`.
In order to run the full suite of provider acceptance tests, run `make testacc`.

*Note:* Acceptance tests create real resources, and often cost money to run.

Expand Down Expand Up @@ -201,6 +195,8 @@ export GITHUB_TEST_USER_TOKEN=

See [this project](https://github.com/terraformtesting/acceptance-tests) for more information on how tests are run automatically.

There are also a small amount of unit tests in the provider. Due to the nature of the provider, such tests are currently only recommended for exercising functionality completely internal to the provider. These may be executed by running `make test`.

### GitHub Personal Access Token

You will need to create a [personal access token](https://help.github.com/en/articles/creating-a-personal-access-token-for-the-command-line) for
Expand Down
9 changes: 5 additions & 4 deletions GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ PKG_NAME=github
default: build

tools:
GO111MODULE=on go install github.com/client9/misspell/cmd/misspell
GO111MODULE=on go install github.com/golangci/golangci-lint/cmd/golangci-lint
go install github.com/client9/misspell/cmd/misspell
go install github.com/golangci/golangci-lint/cmd/golangci-lint

build: fmtcheck
go install
go build ./...

fmt:
@echo "==> Fixing source code with gofmt..."
Expand All @@ -23,7 +23,8 @@ lint:
@echo "==> Checking source code against linters..."
golangci-lint run ./...

test: fmtcheck
test:
go test ./...
# commenting this out for release tooling, please run testacc instead

testacc: fmtcheck
Expand Down
1 change: 1 addition & 0 deletions tools.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build tools
// +build tools

package main
Expand Down