Skip to content

Code commit test

Code commit test #23

Workflow file for this run

# This GitHub action runs your tests for each commit push and/or PR.
name: Build
on:
pull_request:
paths-ignore:
- 'README.md'
- 'docs/**'
jobs:
# ensure the code builds...
build:
name: Build
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Setup Go 1.18
uses: actions/[email protected]
with:
go-version: '1.18'
id: go
- name: Check out the code into the Go module directory
uses: actions/[email protected]
- name: Get dependencies
run: |
go mod download
- name: Build
run: |
go build -v ./b1ddi/b1ddi
lint:
name: Go Linter
runs-on: ubuntu-latest
timeout-minutes: 5
needs: build
steps:
- name: Setup Go 1.18
uses: actions/[email protected]
with:
go-version: '1.18'
id: go
- name: Check out the code into the Go module directory
uses: actions/[email protected]
# Run go lint on the code
- name: Run go lint
run: |
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.54.2
golangci-lint run --max-issues-per-linter 0 --max-same-issues 0 --timeout 10m
tests:
name: Terraform acceptance tests
runs-on: ubuntu-latest
environment: testing
needs: build
steps:
- name: Setup Go 1.18
uses: actions/[email protected]
with:
go-version: '1.18'
id: go
- name: Check out the code into the Go module directory
uses: actions/[email protected]
- name: Get dependencies
run: |
go mod download
- name: Run tests
timeout-minutes: 10
env:
TF_ACC: "1"
B1DDI_HOST: ${{ secrets.BLOXONE_HOST }}
B1DDI_API_KEY: ${{ secrets.BLOXONE_API_KEY }}
INTERNAL_SECONDARY: ${{ secrets.INTERNAL_SECONDARY }}
run: |
echo ${B1DDI_HOST}, ${B1DDI_API_KEY}
go test -v -cover ./b1ddi/b1ddi