From a6503458e1bc08f183cdda994183b9cbd95e8b20 Mon Sep 17 00:00:00 2001 From: Michael Sverdlov Date: Tue, 16 Jul 2024 18:48:18 +0300 Subject: [PATCH] unite actions Signed-off-by: Michael Sverdlov --- .../install-go-with-cache/action.yml | 19 -------------- .../install-local-artifactory/action.yml | 22 ---------------- .github/workflows/accessTests.yml | 2 +- .github/workflows/analysis.yml | 21 ++++++---------- .github/workflows/artifactoryTests.yml | 4 +-- .github/workflows/cla.yml | 25 +++---------------- .github/workflows/distributionTests.yml | 2 +- .github/workflows/dockerTests.yml | 2 +- .../workflows/frogbot-scan-pull-request.yml | 2 +- .github/workflows/frogbot-scan-repository.yml | 2 +- .github/workflows/goTests.yml | 2 +- .github/workflows/gradleTests.yml | 4 +-- .github/workflows/lifecycleTests.yml | 2 +- .github/workflows/mavenTests.yml | 4 +-- .github/workflows/npmTests.yml | 4 +-- .github/workflows/nugetTests.yml | 4 +-- .github/workflows/pluginsTests.yml | 4 +-- .github/workflows/podmanTests.yml | 2 +- .github/workflows/pythonTests.yml | 4 +-- .github/workflows/scriptTests.yml | 2 +- .github/workflows/transferTests.yml | 8 +++--- 21 files changed, 39 insertions(+), 102 deletions(-) delete mode 100644 .github/common-steps/install-go-with-cache/action.yml delete mode 100644 .github/common-steps/install-local-artifactory/action.yml diff --git a/.github/common-steps/install-go-with-cache/action.yml b/.github/common-steps/install-go-with-cache/action.yml deleted file mode 100644 index 1695db418..000000000 --- a/.github/common-steps/install-go-with-cache/action.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: 'Setup and Cache Go and Configure Private' -description: 'Setup and Cache Go 1.22' - -runs: - using: 'composite' - steps: - - 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 - uses: actions/setup-go@v5 - with: - go-version: 1.22.4 - cache: false \ No newline at end of file diff --git a/.github/common-steps/install-local-artifactory/action.yml b/.github/common-steps/install-local-artifactory/action.yml deleted file mode 100644 index 43dd78562..000000000 --- a/.github/common-steps/install-local-artifactory/action.yml +++ /dev/null @@ -1,22 +0,0 @@ -name: 'Setup Local Artifactory' -description: 'Setup Local Artifactory' -inputs: - RTLIC: - description: 'Local Artifactory License' - required: true - JFROG_HOME: - description: 'JFrog Home' - required: false - -runs: - using: 'composite' - steps: - - name: Install Local Artifactory - run: | - go install github.com/jfrog/jfrog-testing-infra/local-rt-setup@latest - ~/go/bin/local-rt-setup - shell: bash - env: - RTLIC: ${{ inputs.RTLIC }} - GOPROXY: direct - JFROG_HOME: ${{ inputs.JFROG_HOME }} \ No newline at end of file diff --git a/.github/workflows/accessTests.yml b/.github/workflows/accessTests.yml index 484b35b35..9831cb69f 100644 --- a/.github/workflows/accessTests.yml +++ b/.github/workflows/accessTests.yml @@ -27,7 +27,7 @@ jobs: with: ref: ${{ github.event.pull_request.head.sha }} - - uses: ./.github/common-steps/install-go-with-cache + - uses: jfrog/.github/.github/actions/install-go-with-cache - name: Run Access tests run: go test -v github.com/jfrog/jfrog-cli --timeout 0 --test.access --jfrog.url=${{ secrets.PLATFORM_URL }} --jfrog.adminToken=${{ secrets.PLATFORM_ADMIN_TOKEN }} --jfrog.user=${{ secrets.PLATFORM_USER }} --ci.runId=${{ runner.os }}-access diff --git a/.github/workflows/analysis.yml b/.github/workflows/analysis.yml index 3015f2fe0..27ecd4b48 100644 --- a/.github/workflows/analysis.yml +++ b/.github/workflows/analysis.yml @@ -23,7 +23,7 @@ jobs: with: ref: ${{ github.event.pull_request.head.sha }} - - uses: ./.github/common-steps/install-go-with-cache + - uses: jfrog/.github/.github/actions/install-go-with-cache - name: Run Go vet run: go vet -v ./... @@ -35,14 +35,12 @@ jobs: - name: Checkout Source uses: actions/checkout@v4 - - uses: ./.github/common-steps/install-go-with-cache + - uses: jfrog/.github/.github/actions/install-go-with-cache - - 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 + - uses: jfrog/.github/.github/actions/install-go-with-cache + - uses: jfrog/.github/.github/actions/golangci-lint + Go-Sec: name: Go-Sec ubuntu-latest runs-on: ubuntu-latest @@ -50,12 +48,9 @@ jobs: - name: Checkout Source uses: actions/checkout@v4 - - uses: ./.github/common-steps/install-go-with-cache - - - name: Run Gosec Security Scanner - uses: securego/gosec@master - with: - args: -exclude G204,G301,G302,G304,G306 -tests -exclude-dir \.*test\.* ./... + - uses: jfrog/.github/.github/actions/install-go-with-cache + + - uses: jfrog/.github/.github/actions/gosec-scanner ShellCheck: name: Shellcheck diff --git a/.github/workflows/artifactoryTests.yml b/.github/workflows/artifactoryTests.yml index e0dab6622..b5adbfd1b 100644 --- a/.github/workflows/artifactoryTests.yml +++ b/.github/workflows/artifactoryTests.yml @@ -28,9 +28,9 @@ jobs: with: ref: ${{ github.event.pull_request.head.sha }} - - uses: ./.github/common-steps/install-go-with-cache + - uses: jfrog/.github/.github/actions/install-go-with-cache - - uses: ./.github/common-steps/install-local-artifactory + - uses: jfrog/.github/.github/actions/install-local-artifactory with: RTLIC: ${{ secrets.RTLIC }} diff --git a/.github/workflows/cla.yml b/.github/workflows/cla.yml index 6813343d7..c61c0be91 100644 --- a/.github/workflows/cla.yml +++ b/.github/workflows/cla.yml @@ -10,26 +10,9 @@ jobs: CLAssistant: runs-on: ubuntu-latest steps: - - uses: actions-ecosystem/action-regex-match@v2 - id: sign-or-recheck + - uses: jfrog/.github/.github/actions/cla 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/github-action@v2.3.0 - 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 }} \ No newline at end of file diff --git a/.github/workflows/distributionTests.yml b/.github/workflows/distributionTests.yml index 59aaaf6d8..e1c950382 100644 --- a/.github/workflows/distributionTests.yml +++ b/.github/workflows/distributionTests.yml @@ -22,7 +22,7 @@ jobs: os: [ ubuntu, windows, macos ] runs-on: ${{ matrix.os }}-latest steps: - - uses: ./.github/common-steps/install-go-with-cache + - uses: jfrog/.github/.github/actions/install-go-with-cache - name: Checkout code uses: actions/checkout@v4 diff --git a/.github/workflows/dockerTests.yml b/.github/workflows/dockerTests.yml index c716332f3..2c428aa20 100644 --- a/.github/workflows/dockerTests.yml +++ b/.github/workflows/dockerTests.yml @@ -23,7 +23,7 @@ jobs: with: ref: ${{ github.event.pull_request.head.sha }} - - uses: ./.github/common-steps/install-go-with-cache + - uses: jfrog/.github/.github/actions/install-go-with-cache - name: Containerize Artifactory run: | diff --git a/.github/workflows/frogbot-scan-pull-request.yml b/.github/workflows/frogbot-scan-pull-request.yml index da90683ec..d2b6d18b7 100644 --- a/.github/workflows/frogbot-scan-pull-request.yml +++ b/.github/workflows/frogbot-scan-pull-request.yml @@ -12,7 +12,7 @@ jobs: # "frogbot" GitHub environment can approve the pull request to be scanned. environment: frogbot steps: - - uses: ./.github/common-steps/install-go-with-cache + - uses: jfrog/.github/.github/actions/install-go-with-cache - uses: jfrog/frogbot@v2 env: diff --git a/.github/workflows/frogbot-scan-repository.yml b/.github/workflows/frogbot-scan-repository.yml index 05099f3ed..54ff06794 100644 --- a/.github/workflows/frogbot-scan-repository.yml +++ b/.github/workflows/frogbot-scan-repository.yml @@ -17,7 +17,7 @@ jobs: # The repository scanning will be triggered periodically on the following branches. branch: [ "dev" ] steps: - - uses: ./.github/common-steps/install-go-with-cache + - uses: jfrog/.github/.github/actions/install-go-with-cache - uses: jfrog/frogbot@v2 env: diff --git a/.github/workflows/goTests.yml b/.github/workflows/goTests.yml index 911b2d8cb..9d83f25c2 100644 --- a/.github/workflows/goTests.yml +++ b/.github/workflows/goTests.yml @@ -28,7 +28,7 @@ jobs: with: ref: ${{ github.event.pull_request.head.sha }} - - uses: ./.github/common-steps/install-go-with-cache + - uses: jfrog/.github/.github/actions/install-go-with-cache - name: Run Go tests run: go test -v -timeout 0 --test.go --jfrog.url=${{ secrets.PLATFORM_URL }} --jfrog.adminToken=${{ secrets.PLATFORM_ADMIN_TOKEN }} --ci.runId=${{ runner.os }}-go diff --git a/.github/workflows/gradleTests.yml b/.github/workflows/gradleTests.yml index 515a26e3a..2a9156e78 100644 --- a/.github/workflows/gradleTests.yml +++ b/.github/workflows/gradleTests.yml @@ -41,9 +41,9 @@ jobs: with: gradle-version: ${{ matrix.gradle-version }} - - uses: ./.github/common-steps/install-go-with-cache + - uses: jfrog/.github/.github/actions/install-go-with-cache - - uses: ./.github/common-steps/install-local-artifactory + - uses: jfrog/.github/.github/actions/install-local-artifactory with: RTLIC: ${{ secrets.RTLIC }} diff --git a/.github/workflows/lifecycleTests.yml b/.github/workflows/lifecycleTests.yml index d305ce4bd..4da2c8586 100644 --- a/.github/workflows/lifecycleTests.yml +++ b/.github/workflows/lifecycleTests.yml @@ -27,7 +27,7 @@ jobs: with: ref: ${{ github.event.pull_request.head.sha }} - - uses: ./.github/common-steps/install-go-with-cache + - uses: jfrog/.github/.github/actions/install-go-with-cache - name: Run Lifecycle tests run: go test -v github.com/jfrog/jfrog-cli --timeout 0 --test.lifecycle --jfrog.url=${{ secrets.PLATFORM_URL }} --jfrog.adminToken=${{ secrets.PLATFORM_ADMIN_TOKEN }} --jfrog.user=${{ secrets.PLATFORM_USER }} --ci.runId=${{ runner.os }}-lifecycle diff --git a/.github/workflows/mavenTests.yml b/.github/workflows/mavenTests.yml index 03e051b93..e67badeb9 100644 --- a/.github/workflows/mavenTests.yml +++ b/.github/workflows/mavenTests.yml @@ -27,7 +27,7 @@ jobs: with: ref: ${{ github.event.pull_request.head.sha }} - - uses: ./.github/common-steps/install-go-with-cache + - uses: jfrog/.github/.github/actions/install-go-with-cache - name: Setup Maven v3.8.8 for macOS uses: stCarolas/setup-maven@v4.5 @@ -35,7 +35,7 @@ jobs: maven-version: 3.8.8 if: runner.os == 'macOS' - - uses: ./.github/common-steps/install-local-artifactory + - uses: jfrog/.github/.github/actions/install-local-artifactory with: RTLIC: ${{ secrets.RTLIC }} diff --git a/.github/workflows/npmTests.yml b/.github/workflows/npmTests.yml index 935837a18..33103f8be 100644 --- a/.github/workflows/npmTests.yml +++ b/.github/workflows/npmTests.yml @@ -32,9 +32,9 @@ jobs: with: node-version: "16" - - uses: ./.github/common-steps/install-go-with-cache + - uses: jfrog/.github/.github/actions/install-go-with-cache - - uses: ./.github/common-steps/install-local-artifactory + - uses: jfrog/.github/.github/actions/install-local-artifactory with: RTLIC: ${{ secrets.RTLIC }} diff --git a/.github/workflows/nugetTests.yml b/.github/workflows/nugetTests.yml index 38bf95726..714a053b3 100644 --- a/.github/workflows/nugetTests.yml +++ b/.github/workflows/nugetTests.yml @@ -38,9 +38,9 @@ jobs: dotnet-version: "6.x" - - uses: ./.github/common-steps/install-go-with-cache + - uses: jfrog/.github/.github/actions/install-go-with-cache - - uses: ./.github/common-steps/install-local-artifactory + - uses: jfrog/.github/.github/actions/install-local-artifactory with: RTLIC: ${{ secrets.RTLIC }} diff --git a/.github/workflows/pluginsTests.yml b/.github/workflows/pluginsTests.yml index 6cb139773..78e311b59 100644 --- a/.github/workflows/pluginsTests.yml +++ b/.github/workflows/pluginsTests.yml @@ -27,9 +27,9 @@ jobs: with: ref: ${{ github.event.pull_request.head.sha }} - - uses: ./.github/common-steps/install-go-with-cache + - uses: jfrog/.github/.github/actions/install-go-with-cache - - uses: ./.github/common-steps/install-local-artifactory + - uses: jfrog/.github/.github/actions/install-local-artifactory with: RTLIC: ${{ secrets.RTLIC }} diff --git a/.github/workflows/podmanTests.yml b/.github/workflows/podmanTests.yml index 1f27b788a..9e2f2773e 100644 --- a/.github/workflows/podmanTests.yml +++ b/.github/workflows/podmanTests.yml @@ -23,7 +23,7 @@ jobs: with: ref: ${{ github.event.pull_request.head.sha }} - - uses: ./.github/common-steps/install-go-with-cache + - uses: jfrog/.github/.github/actions/install-go-with-cache - name: Run podman tests run: go test -v -timeout 0 --test.podman --jfrog.url=${{ secrets.PLATFORM_URL }} --jfrog.adminToken=${{ secrets.PLATFORM_ADMIN_TOKEN }} --test.containerRegistry=${{ secrets.CONTAINER_REGISTRY }} diff --git a/.github/workflows/pythonTests.yml b/.github/workflows/pythonTests.yml index e62b91754..f7ea33c63 100644 --- a/.github/workflows/pythonTests.yml +++ b/.github/workflows/pythonTests.yml @@ -38,9 +38,9 @@ jobs: if: ${{ matrix.suite == 'pipenv' }} run: python -m pip install pipenv - - uses: ./.github/common-steps/install-go-with-cache + - uses: jfrog/.github/.github/actions/install-go-with-cache - - uses: ./.github/common-steps/install-local-artifactory + - uses: jfrog/.github/.github/actions/install-local-artifactory with: RTLIC: ${{ secrets.RTLIC }} diff --git a/.github/workflows/scriptTests.yml b/.github/workflows/scriptTests.yml index 65d8df7cb..d8f2c8bd0 100644 --- a/.github/workflows/scriptTests.yml +++ b/.github/workflows/scriptTests.yml @@ -40,7 +40,7 @@ jobs: with: ref: ${{ github.event.pull_request.head.sha }} - - uses: ./.github/common-steps/install-go-with-cache + - uses: jfrog/.github/.github/actions/install-go-with-cache - name: Test install CLI - jf run: | diff --git a/.github/workflows/transferTests.yml b/.github/workflows/transferTests.yml index c04f55152..458eaedde 100644 --- a/.github/workflows/transferTests.yml +++ b/.github/workflows/transferTests.yml @@ -27,9 +27,9 @@ jobs: with: ref: ${{ github.event.pull_request.head.sha }} - - uses: ./.github/common-steps/install-go-with-cache + - uses: jfrog/.github/.github/actions/install-go-with-cache - - uses: ./.github/common-steps/install-local-artifactory + - uses: jfrog/.github/.github/actions/install-local-artifactory with: RTLIC: ${{ secrets.RTLIC }} JFROG_HOME: ${{ runner.temp }} @@ -47,9 +47,9 @@ jobs: with: ref: ${{ github.event.pull_request.head.sha }} - - uses: ./.github/common-steps/install-go-with-cache + - uses: jfrog/.github/.github/actions/install-go-with-cache - - uses: ./.github/common-steps/install-local-artifactory + - uses: jfrog/.github/.github/actions/install-local-artifactory with: RTLIC: ${{ secrets.RTLIC }} JFROG_HOME: ${{ runner.temp }}