86 lines
1.7 KiB
YAML
86 lines
1.7 KiB
YAML
name: Acceptance Tests
|
|
on:
|
|
pull_request:
|
|
paths-ignore:
|
|
- 'README.md'
|
|
push:
|
|
paths-ignore:
|
|
- 'README.md'
|
|
schedule:
|
|
- cron: '0 13 * * *'
|
|
jobs:
|
|
|
|
build:
|
|
name: Build
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 5
|
|
steps:
|
|
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v2.1.3
|
|
with:
|
|
go-version: '1.16'
|
|
id: go
|
|
|
|
- name: Check out code into the Go module directory
|
|
uses: actions/checkout@v2.3.4
|
|
|
|
- name: Get dependencies
|
|
run: |
|
|
go mod download
|
|
|
|
- name: Build
|
|
run: |
|
|
go build -v .
|
|
|
|
test:
|
|
name: Matrix Test
|
|
needs: build
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 15
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
version:
|
|
- stable-5
|
|
- '6.0.45'
|
|
- '6.1.71'
|
|
- '6.2.23'
|
|
- v6
|
|
terraform:
|
|
- '0.15.5'
|
|
- '1.0.4'
|
|
steps:
|
|
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v2.1.3
|
|
with:
|
|
go-version: '1.16'
|
|
id: go
|
|
|
|
- name: Check out code into the Go module directory
|
|
uses: actions/checkout@v2.3.4
|
|
|
|
# TODO: convert this to `services`
|
|
- name: Start Unifi controller
|
|
run: |
|
|
./controller.sh start ${{ matrix.version }}
|
|
|
|
- name: Get dependencies
|
|
run: |
|
|
go mod download
|
|
|
|
- name: TF acceptance tests
|
|
timeout-minutes: 10
|
|
env:
|
|
TF_ACC: "1"
|
|
TF_ACC_TERRAFORM_VERSION: ${{ matrix.terraform }}
|
|
|
|
UNIFI_USERNAME: tfacctest
|
|
UNIFI_PASSWORD: tfacctest1234
|
|
UNIFI_API: https://localhost:8443/
|
|
UNIFI_ACC_WLAN_CONCURRENCY: "4"
|
|
UNIFI_INSECURE: 'true'
|
|
run: |
|
|
go test -v -cover ./internal/provider/
|