-
Notifications
You must be signed in to change notification settings - Fork 94
67 lines (64 loc) · 2.14 KB
/
build.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
name: Golang lint, golic and test
on:
push:
paths-ignore:
- '**.md'
- '**.svg'
- '**.drawio'
- '.spelling'
pull_request:
branches:
- master
paths-ignore:
- '**.md'
- '**.svg'
- '**.drawio'
- '.spelling'
permissions: # added using https://github.com/step-security/secure-workflows
contents: read
jobs:
skip-check:
permissions:
actions: write # for fkirc/skip-duplicate-actions to skip or stop workflow runs
contents: read # for fkirc/skip-duplicate-actions to read and compare commits
runs-on: ubuntu-latest
name: Skip the job?
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- name: Harden Runner
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs
- id: skip_check
uses: fkirc/skip-duplicate-actions@84931c63f7562abc89860097e0caf563c7b87f65
with:
skip_after_successful_duplicate: 'true'
do_not_skip: '["workflow_dispatch", "schedule"]'
go-inspect:
permissions:
contents: read # for actions/checkout to fetch code
pull-requests: read # for golangci/golangci-lint-action to fetch pull requests
name: Inspect packages
runs-on: ubuntu-22.04
needs: skip-check
if: ${{ needs.skip-check.outputs.should_skip != 'true' }}
steps:
- name: Set up Go
uses: actions/setup-go@bfd2fb341f32be7281829126376a12a780ca79fc
with:
go-version: 1.22.3
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
# see: https://golangci-lint.run/usage/configuration/#config-file
- name: golangci-lint
uses: golangci/golangci-lint-action@aaa42aa0628b4ae2578232a66b541047968fac86 # v6.1.0
with:
version: v1.59.1
skip-go-installation: true
args: --timeout=3m
- name: golic
run: |
go install github.com/AbsaOSS/[email protected]
golic inject --dry -x -t apache2
- name: go test
run: go test ./...