Skip to content

Commit dda78c0

Browse files
authored
Merge pull request #216 from terraform-providers/workflow
Use Github Actions Workflows
2 parents 95538fe + 44ede13 commit dda78c0

File tree

6 files changed

+104
-26
lines changed

6 files changed

+104
-26
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* -text
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Acceptance Tests
2+
on: [push,pull_request]
3+
4+
jobs:
5+
acceptance-ce:
6+
runs-on: ubuntu-latest
7+
steps:
8+
- name: Set up Go
9+
uses: actions/setup-go@v1
10+
with:
11+
go-version: 1.12
12+
id: go
13+
14+
- name: Check out code repository source code
15+
uses: actions/checkout@v2
16+
17+
# https://help.github.com/en/actions/reference/workflow-commands-for-github-actions
18+
- name: Set build variables
19+
run: |
20+
echo "::set-env name=MAKE_TARGET::testacc"
21+
echo "::set-env name=GO_FLAGS::-mod=vendor"
22+
echo "::set-env name=GO111MODULE::on"
23+
24+
- name: Start Gitlab and run acceptance tests
25+
run: |
26+
bash scripts/start-gitlab.sh
27+
make $MAKE_TARGET

.github/workflows/unit-tests.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Unit Tests
2+
on: [push,pull_request]
3+
4+
jobs:
5+
test:
6+
runs-on: ${{ matrix.os }}
7+
strategy:
8+
fail-fast: false
9+
matrix:
10+
go: [1.12, 1.13, 1.14]
11+
os: [ubuntu-latest, macos-latest, windows-latest]
12+
make_target: [test, vet]
13+
14+
steps:
15+
- name: Set up Go
16+
uses: actions/setup-go@v1
17+
with:
18+
go-version: ${{ matrix.go }}
19+
id: go
20+
21+
- name: Check out code repository source code
22+
uses: actions/checkout@v2
23+
24+
# https://help.github.com/en/actions/reference/workflow-commands-for-github-actions
25+
- name: Set build variables
26+
run: |
27+
echo "::set-env name=MAKE_TARGET::${{ matrix.make_target }}"
28+
echo "::set-env name=GO_FLAGS::-mod=vendor"
29+
echo "::set-env name=GO111MODULE::on"
30+
31+
- name: Run ${{matrix.make_target}}
32+
run: |
33+
make $MAKE_TARGET

.github/workflows/website.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Website Build
2+
on: [push,pull_request]
3+
4+
jobs:
5+
website:
6+
runs-on: ubuntu-latest
7+
8+
steps:
9+
- name: Set up Go
10+
uses: actions/setup-go@v1
11+
with:
12+
go-version: 1.12
13+
id: go
14+
15+
# https://help.github.com/en/actions/reference/workflow-commands-for-github-actions
16+
- name: Set Go variables for backwards compatibility
17+
run: |
18+
echo "::set-env name=GOPATH::$GITHUB_WORKSPACE/go"
19+
echo "::set-env name=GOBIN::$GITHUB_WORKSPACE/go/bin"
20+
echo "::add-path::$GITHUB_WORKSPACE/go/bin"
21+
22+
- name: Check out code repository source code
23+
uses: actions/checkout@v2
24+
with:
25+
path: go/src/github.com/${{ github.repository }}
26+
27+
- name: Run website-test
28+
run: |
29+
cd $GOPATH/src/github.com/${{ github.repository }}
30+
export MAKE_TARGET=${{ matrix.make_target }}
31+
export GOFLAGS=-mod=vendor
32+
export GO111MODULE=on
33+
make website-test

.travis.yml

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,34 +2,13 @@ language: go
22
matrix:
33
fast_finish: false
44
include:
5-
- name: unit tests
6-
env: MAKE_TARGET=test GOFLAGS=-mod=vendor GO111MODULE=on
7-
go: "1.12.x"
85
- name: acceptance tests EE
96
env: MAKE_TARGET=testacc GITLAB_LICENSE_FILE=JulienPivotto.gitlab-license GOFLAGS=-mod=vendor GO111MODULE=on GITLAB_BASE_URL=http://127.0.0.1:8080/api/v4 GITLAB_TOKEN=ACCTEST
107
go: "1.12.x"
118
- name: acceptance tests CE
129
env: MAKE_TARGET=testacc GOFLAGS=-mod=vendor GO111MODULE=on GITLAB_BASE_URL=http://127.0.0.1:8080/api/v4 GITLAB_TOKEN=ACCTEST
1310
go: "1.12.x"
14-
- name: govet tests
15-
env: MAKE_TARGET=vet GOFLAGS=-mod=vendor GO111MODULE=on
16-
go: "1.12.x"
17-
- name: website tests
18-
env: MAKE_TARGET=website-test GOFLAGS=-mod=vendor GO111MODULE=on
19-
go: "1.12.x"
20-
- name: unit tests (go 1.12)
21-
env: MAKE_TARGET=test GOFLAGS=-mod=vendor GO111MODULE=on
22-
go: "1.13.x"
23-
- name: unit tests (go tip)
24-
env: MAKE_TARGET=test GOFLAGS=-mod=vendor GO111MODULE=on
25-
go: tip
2611
allow_failures:
27-
- name: unit tests (go tip)
28-
env: MAKE_TARGET=test GOFLAGS=-mod=vendor GO111MODULE=on
29-
go: tip
30-
- name: unit tests (go 1.12)
31-
env: MAKE_TARGET=test GOFLAGS=-mod=vendor GO111MODULE=on
32-
go: "1.13.x"
3312
- name: acceptance tests EE
3413
env: MAKE_TARGET=testacc GITLAB_LICENSE_FILE=JulienPivotto.gitlab-license GOFLAGS=-mod=vendor GO111MODULE=on GITLAB_BASE_URL=http://127.0.0.1:8080/api/v4 GITLAB_TOKEN=ACCTEST
3514
go: "1.12.x"

README.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,22 @@
1-
Terraform Provider
2-
==================
1+
Terraform Provider for Gitlab
2+
=============================
33

4-
- Website: https://www.terraform.io
4+
- [Documentation](https://www.terraform.io/docs/providers/gitlab/index.html)
55
- [![Gitter chat](https://badges.gitter.im/hashicorp-terraform/Lobby.png)](https://gitter.im/hashicorp-terraform/Lobby)
66
- Mailing list: [Google Groups](http://groups.google.com/group/terraform-tool)
7+
- Build status:
8+
- ![Unit Tests](https://github.com/terraform-providers/terraform-provider-gitlab/workflows/Unit%20Tests/badge.svg)
9+
- ![Acceptance Tests](https://github.com/terraform-providers/terraform-provider-gitlab/workflows/Acceptance%20Tests/badge.svg)
10+
- ![Website Build](https://github.com/terraform-providers/terraform-provider-gitlab/workflows/Website%20Build/badge.svg)
11+
712

813
<img src="https://cdn.rawgit.com/hashicorp/terraform-website/master/content/source/assets/images/logo-hashicorp.svg" width="600px">
914

1015
Requirements
1116
------------
1217

13-
- [Terraform](https://www.terraform.io/downloads.html) 0.10.x
14-
- [Go](https://golang.org/doc/install) 1.11 (to build the provider plugin)
18+
- [Terraform](https://www.terraform.io/downloads.html) 0.12.x
19+
- [Go](https://golang.org/doc/install) 1.12 (to build the provider plugin)
1520

1621
Building The Provider
1722
---------------------

0 commit comments

Comments
 (0)