Skip to content

Commit

Permalink
Unite all common GitHub action steps (#1203)
Browse files Browse the repository at this point in the history
  • Loading branch information
sverdlov93 authored Jul 22, 2024
1 parent d9bdefe commit cd11034
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 65 deletions.
27 changes: 6 additions & 21 deletions .github/workflows/analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,33 +13,18 @@ jobs:
- name: Checkout Source
uses: actions/checkout@v4

- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: 1.22.x
cache: false

- name: Static Code Analysis
uses: golangci/golangci-lint-action@v4
with:
args: |
--timeout 5m --out-${NO_FUTURE}format colored-line-number --enable errcheck,gosimple,govet,ineffassign,staticcheck,typecheck,unused,gocritic,asasalint,asciicheck,errchkjson,exportloopref,forcetypeassert,makezero,nilerr,unparam,unconvert,wastedassign,usestdlibvars
- 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@v4

- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: 1.22.x
cache: false
- name: Setup Go with cache
uses: jfrog/.github/actions/install-go-with-cache@main

- name: Run Gosec Security Scanner
# Temporarily set version 2.18.0 to workaround https://github.com/securego/gosec/issues/1046
uses: securego/[email protected]
with:
args: -exclude G204,G301,G302,G304,G306 -tests -exclude-dir \.*test\.* ./...
26 changes: 5 additions & 21 deletions .github/workflows/cla.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,10 @@ jobs:
CLAssistant:
runs-on: ubuntu-latest
steps:
- uses: actions-ecosystem/action-regex-match@v2
id: sign-or-recheck
- name: Run CLA Check
uses: jfrog/.github/actions/cla@main
with:
text: ${{ github.event.comment.body }}
regex: '\s*(I have read the CLA Document and I hereby sign the CLA)|(recheck)\s*'

- name: "CLA Assistant"
if: ${{ steps.sign-or-recheck.outputs.match != '' || github.event_name == 'pull_request_target' }}
# Alpha Release
uses: cla-assistant/[email protected]
env:
# Generated and maintained by GitHub
event_comment_body: ${{ github.event.comment.body }}
event_name: ${{ github.event_name }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# JFrog organization secret
PERSONAL_ACCESS_TOKEN: ${{ secrets.CLA_SIGN_TOKEN }}
with:
path-to-signatures: 'signed_clas.json'
path-to-document: 'https://jfrog.com/cla/'
remote-organization-name: 'jfrog'
remote-repository-name: 'jfrog-signed-clas'
# branch should not be protected
branch: 'master'
allowlist: bot*
CLA_SIGN_TOKEN: ${{ secrets.CLA_SIGN_TOKEN }}
7 changes: 2 additions & 5 deletions .github/workflows/frogbot-scan-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,8 @@ jobs:
# "frogbot" GitHub environment can approve the pull request to be scanned.
environment: frogbot
steps:
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: 1.22.x
cache: false
- name: Setup Go with cache
uses: jfrog/.github/actions/install-go-with-cache@main

- uses: jfrog/frogbot@v2
env:
Expand Down
7 changes: 2 additions & 5 deletions .github/workflows/frogbot-scan-repository.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,8 @@ jobs:
# The repository scanning will be triggered periodically on the following branches.
branch: [ "dev" ]
steps:
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: 1.22.x
cache: false
- name: Setup Go with cache
uses: jfrog/.github/actions/install-go-with-cache@main

- uses: jfrog/frogbot@v2
env:
Expand Down
15 changes: 2 additions & 13 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,6 @@ jobs:
- name: Install pipenv & poetry
run: python -m pip install pipenv poetry

- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: 1.22.x
cache: false

- name: Install NuGet
uses: nuget/setup-nuget@v2
with:
Expand All @@ -44,13 +38,8 @@ jobs:
with:
dotnet-version: '6.x'

- name: Go Cache
uses: actions/cache@v4
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Setup Go with cache
uses: jfrog/.github/actions/install-go-with-cache@main

- name: Tests
run: go test -v github.com/jfrog/jfrog-cli-core/v2/tests -timeout 0 -race

0 comments on commit cd11034

Please sign in to comment.