78a58981fa
Tagging/Releasing will be refactored so it can be executed manually via `workflow_disaptch`.
78 lines
1.7 KiB
YAML
78 lines
1.7 KiB
YAML
name: Test
|
|
on: [push]
|
|
|
|
jobs:
|
|
|
|
lint:
|
|
name: Lint
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v2.1.3
|
|
with:
|
|
go-version: 1.14
|
|
id: go
|
|
|
|
- name: Checkout
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Install golangci-lint
|
|
run: curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.23.7
|
|
|
|
- name: Lint
|
|
run: $(go env GOPATH)/bin/golangci-lint run
|
|
|
|
test:
|
|
name: Test
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
|
|
- name: Set up Go 1.14
|
|
uses: actions/setup-go@v2.1.3
|
|
with:
|
|
go-version: 1.14
|
|
id: go
|
|
|
|
- name: Checkout
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Test
|
|
run: go test -coverprofile cover.out ./...
|
|
|
|
- name: SonarCloud Scan
|
|
uses: sonarsource/sonarcloud-github-action@master
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
|
|
|
image-scan:
|
|
name: Image Scan
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Unshallow
|
|
run: git fetch --prune --unshallow
|
|
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v2.1.3
|
|
with:
|
|
go-version: 1.14
|
|
id: go
|
|
|
|
- name: Run GoReleaser
|
|
uses: goreleaser/goreleaser-action@v2.2.1
|
|
with:
|
|
version: latest
|
|
args: release --rm-dist --skip-validate --skip-publish
|
|
key: ${{ secrets.YOUR_PRIVATE_KEY }}
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Scan image
|
|
uses: anchore/scan-action@v2
|
|
with:
|
|
image: "hipages/php-fpm_exporter:latest"
|
|
fail-build: true
|