php-fpm-exporter/.github/workflows/test.yml
dependabot-preview[bot] 8006fab056
chore(deps): bump github.com/prometheus/client_golang from 1.5.1 to 1.8.0 (#111)
* chore(deps): bump github.com/prometheus/client_golang

Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.5.1 to 1.8.0.
- [Release notes](https://github.com/prometheus/client_golang/releases)
- [Changelog](https://github.com/prometheus/client_golang/blob/master/CHANGELOG.md)
- [Commits](https://github.com/prometheus/client_golang/compare/v1.5.1...v1.8.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

* chore: use anchore/scan-action@v2

* chore: adjust params for anchor v2

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: Enrico Stahn <enrico.stahn@gmail.com>
2020-11-02 22:59:44 +11:00

102 lines
2.3 KiB
YAML

name: Test
on: [push]
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v1
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@v1
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@v1
with:
go-version: 1.14
id: go
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v1
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
tag:
name: Tag
runs-on: ubuntu-latest
needs: [lint, test, image-scan]
if: github.ref == 'refs/heads/master'
steps:
- name: Setup Node.js for use with actions
uses: actions/setup-node@v1.1.0
- name: Checkout
uses: actions/checkout@v2
- name: Unshallow
run: git fetch --prune --unshallow
- name: Install semantic-release
run: yarn global add --no-progress --non-interactive "semantic-release" "@semantic-release/exec"
- name: Run semantic-release
run: $(yarn global bin)/semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}