php-fpm-exporter/.github/workflows/test.yml

89 lines
1.8 KiB
YAML
Raw Normal View History

2020-03-11 00:54:39 +00:00
name: Test
on:
pull_request_target:
workflow_dispatch:
push:
branches:
- master
- 'releases/*'
2020-03-21 03:55:18 +00:00
2020-03-03 05:33:41 +00:00
jobs:
2020-03-03 10:59:20 +00:00
lint:
2020-03-03 05:46:33 +00:00
name: Lint
2020-03-03 05:33:41 +00:00
runs-on: ubuntu-latest
steps:
2020-03-04 04:59:37 +00:00
- name: Set up Go
uses: actions/setup-go@v2.1.4
2020-03-03 05:33:41 +00:00
with:
2022-02-08 21:56:44 +00:00
go-version: 1.17
2020-03-03 05:33:41 +00:00
id: go
2020-03-04 04:59:37 +00:00
- name: Checkout
uses: actions/checkout@v2.3.4
2020-03-03 05:33:41 +00:00
- name: golangci-lint
uses: golangci/golangci-lint-action@v2.5.2
with:
2022-02-08 21:56:44 +00:00
version: v1.44
2020-03-03 10:59:20 +00:00
test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Setup Go
uses: actions/setup-go@v2.1.4
2020-03-03 10:59:20 +00:00
with:
2022-02-08 21:56:44 +00:00
go-version: 1.17
2020-03-03 10:59:20 +00:00
id: go
2020-03-04 04:59:37 +00:00
- name: Checkout
uses: actions/checkout@v2.3.4
2020-03-03 10:59:20 +00:00
- name: Test
2020-03-11 12:47:36 +00:00
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 }}
2020-03-04 04:59:37 +00:00
image-scan:
name: Image Scan
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2.3.4
- name: Unshallow
run: git fetch --prune --unshallow
- name: Setup Go
uses: actions/setup-go@v2.1.4
with:
2022-02-08 21:56:44 +00:00
go-version: 1.17
id: go
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2.8.1
with:
version: latest
args: release --rm-dist --skip-validate --skip-publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Scan image
uses: anchore/scan-action@v3.2.0
2022-02-16 21:04:28 +00:00
id: scan
with:
image: "hipages/php-fpm_exporter:latest"
2022-02-16 21:04:28 +00:00
acs-report-enable: true
- name: Upload Anchore scan SARIF report
uses: github/codeql-action/upload-sarif@v1
with:
sarif_file: ${{ steps.scan.outputs.sarif }}