forked from jfrog/jfrog-cli-core
-
Notifications
You must be signed in to change notification settings - Fork 0
97 lines (85 loc) · 2.62 KB
/
analysis.yml
File metadata and controls
97 lines (85 loc) · 2.62 KB
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
name: "Static Analysis"
on:
push:
branches:
- "master"
tags-ignore:
- "**"
pull_request_target:
types: [labeled]
branches:
- "master"
permissions:
contents: read
pull-requests: read
jobs:
Static-Check:
runs-on: ubuntu-latest
steps:
- name: Checkout Source
uses: actions/checkout@v6
with:
ref: ${{ github.event.pull_request.head.sha || github.ref }}
- name: Setup Go with cache
uses: jfrog/.github/actions/install-go-with-cache@main
- name: Run golangci linter
uses: jfrog/.github/actions/golangci-lint@main
Go-Sec:
runs-on: ubuntu-latest
steps:
- name: Checkout Source
uses: actions/checkout@v6
with:
ref: ${{ github.event.pull_request.head.sha || github.ref }}
fetch-depth: 0
- name: Setup Go with cache
uses: jfrog/.github/actions/install-go-with-cache@main
- name: Run Go-Sec scanner
uses: jfrog/.github/actions/gosec-scanner@main
No-Replace:
runs-on: ubuntu-latest
steps:
- name: Checkout Source
uses: actions/checkout@v6
with:
ref: ${{ github.event.pull_request.head.sha || github.ref }}
- name: Check for uncommented replace instructions
run: |
if grep -E '^[[:space:]]*replace[[:space:]]' go.mod; then
echo "❌ Found uncommented replace directives in go.mod"
echo "All replace directives should be commented out"
exit 1
else
echo "✅ No uncommented replace directives found in go.mod"
fi
Validate-CLI-Compatibility:
name: Validate ${{ matrix.repo }} Compatibility
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- repo: jfrog-cli-security
branch: dev
- repo: jfrog-cli-artifactory
branch: main
steps:
- name: Checkout CLI Core Source
uses: actions/checkout@v6
with:
ref: ${{ github.event.pull_request.head.sha || github.ref }}
- name: Checkout ${{ matrix.repo }} Source - ${{ matrix.branch }} branch
uses: actions/checkout@v6
with:
repository: jfrog/${{ matrix.repo }}
ref: ${{ matrix.branch }}
path: ${{ matrix.repo }}
- name: Replace To Local Core in ${{ matrix.repo }}
run: |
cd ${{ matrix.repo }}
go mod edit -replace github.com/jfrog/jfrog-cli-core/v2=${GITHUB_WORKSPACE}
go mod tidy
- name: Run go vet on ${{ matrix.repo }}
run: |
cd ${{ matrix.repo }}
go vet ./...