mirror of
https://github.com/SAP/jenkins-library.git
synced 2024-12-14 11:03:09 +02:00
0b3b4aae3d
* chore: streamline GH actions * force use of local piper * look for piper in project root * use local piper * Update .github/workflows/verify-go.yml * remove chmod
75 lines
1.7 KiB
YAML
75 lines
1.7 KiB
YAML
name: Go
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
pull_request:
|
|
branches:
|
|
- master
|
|
|
|
jobs:
|
|
unit:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/setup-go@v1
|
|
with:
|
|
go-version: '1.13.x'
|
|
- name: checkout
|
|
uses: actions/checkout@v2
|
|
- name: unit-test
|
|
run: go test ./... --cover
|
|
format:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/setup-go@v1
|
|
with:
|
|
go-version: '1.13.x'
|
|
- name: checkout
|
|
uses: actions/checkout@v2
|
|
- name: format
|
|
run: go fmt ./...
|
|
- name: verify
|
|
run: git diff --name-only --exit-code
|
|
generate:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/setup-go@v1
|
|
with:
|
|
go-version: '1.13.x'
|
|
- name: checkout
|
|
uses: actions/checkout@v2
|
|
- name: generate
|
|
run: go run pkg/generator/step-metadata.go
|
|
- name: verify
|
|
run: git diff --name-only --exit-code
|
|
dependencies:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/setup-go@v1
|
|
with:
|
|
go-version: '1.13.x'
|
|
- name: checkout
|
|
uses: actions/checkout@v2
|
|
- name: cleanup dependencies
|
|
run: go mod tidy
|
|
- name: verify
|
|
run: git diff --name-only --exit-code
|
|
integration:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/setup-go@v1
|
|
with:
|
|
go-version: '1.13.x'
|
|
- name: checkout
|
|
uses: actions/checkout@v2
|
|
- name: build
|
|
env:
|
|
CGO_ENABLED: 0
|
|
# with `-tags release` we ensure that shared test utilities won't end up in the binary
|
|
run: go build -o piper -tags release
|
|
- name: test
|
|
env:
|
|
PIPER_INTEGRATION_GITHUB_TOKEN: ${{secrets.PIPER_INTEGRATION_GITHUB_TOKEN}}
|
|
run: go test -tags=integration ./integration/...
|