This repository has been archived by the owner on Jul 18, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (60 loc) · 1.84 KB
/
push-pr-lint.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
name: lint, test and build image
on: [pull_request, push]
jobs:
lint-test:
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: '1.21'
- name: Checkout code
uses: actions/checkout@v4
- name: golangci-lint
uses: golangci/golangci-lint-action@v5
with:
args: --config .golangci.yml --timeout 2m
version: v1.55.2
- name: Test
run: go test ./...
build:
runs-on: ubuntu-latest
needs: [lint-test]
steps:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: '1.21'
- name: Checkout code
uses: actions/checkout@v4
- name: build binary
run: make build
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build Docker image - no push
id: docker-build
uses: docker/build-push-action@v5
with:
context: .
push: false
tags: ghcr.io/metal-toolbox/fleet-rest-skeleton:latest
file: Dockerfile
- name: Scan image
id: scan-image
uses: anchore/scan-action@v3
with:
image: ghcr.io/metal-toolbox/fleet-rest-skeleton:latest
acs-report-enable: true
# TODO(joel): Fail build once we migrate off CentOS.
fail-build: false
# TODO(joel): Uncomment once we migrate off CentOS.
# - name: upload Anchore scan SARIF report
# uses: github/codeql-action/upload-sarif@v2
# with:
# sarif_file: ${{ steps.scan.outputs.sarif }}
# # This should run even if we fail the container scan
# if: always()
- name: Inspect action SARIF report
run: cat ${{ steps.scan.outputs.sarif }}
# This should run even if we fail the container scan
if: always()