Skip to content

Commit

Permalink
Merge pull request #1048 from kfcampbell/small-ci-cleanup
Browse files Browse the repository at this point in the history
Small CI cleanup
  • Loading branch information
kfcampbell authored Jan 27, 2022
2 parents f9508c5 + e4773c9 commit fd0b40c
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 16 deletions.
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

0 comments on commit fd0b40c

Please sign in to comment.