From 7ce4ebb892984976bf520f333ef27c304b81c538 Mon Sep 17 00:00:00 2001 From: oumkale Date: Thu, 7 Dec 2023 21:46:04 +0530 Subject: [PATCH] Adding github templates and workflow Signed-off-by: oumkale --- .github/workflows/action-test.yml | 32 --------------- .github/workflows/analysis.yml | 66 ------------------------------- .github/workflows/test.yml | 55 -------------------------- 3 files changed, 153 deletions(-) delete mode 100644 .github/workflows/action-test.yml delete mode 100644 .github/workflows/analysis.yml diff --git a/.github/workflows/action-test.yml b/.github/workflows/action-test.yml deleted file mode 100644 index 9eec58f..0000000 --- a/.github/workflows/action-test.yml +++ /dev/null @@ -1,32 +0,0 @@ -name: "GitHub Action Test" -on: - push: - tags-ignore: - - '**' - pull_request: -jobs: - test: - runs-on: ${{ matrix.os }} - defaults: - run: - working-directory: action - strategy: - matrix: - os: [ubuntu-latest, windows-latest, macOS-latest] - fail-fast: false - steps: - # Checkout and install prerequisites - - name: Checkout - uses: actions/checkout@v4 - - name: Setup NodeJS - uses: actions/setup-node@v3 - with: - node-version: "16.x" - - # Install and run tests - - name: Install - run: npm i - - name: Lint - run: npm run lint - - name: Unit tests - run: npm t diff --git a/.github/workflows/analysis.yml b/.github/workflows/analysis.yml deleted file mode 100644 index 1f6e181..0000000 --- a/.github/workflows/analysis.yml +++ /dev/null @@ -1,66 +0,0 @@ -name: "Static Analysis" -on: - push: - tags-ignore: - - '**' - pull_request: -jobs: - Static-Check: - runs-on: ubuntu-latest - steps: - - name: Checkout Source - uses: actions/checkout@v4 - - - name: Install Go - uses: actions/setup-go@v3 - with: - go-version: 1.20.x - - - name: Go Cache - uses: actions/cache@v3 - with: - path: ~/go/pkg/mod - key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} - restore-keys: ${{ runner.os }}-go- - - # Generate mocks - - name: Generate mocks - run: go generate ./... - - - name: Static Code Analysis - uses: golangci/golangci-lint-action@v3 - 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 - - Go-Sec: - runs-on: ubuntu-latest - env: - GOFLAGS: -buildvcs=false - steps: - - name: Checkout Source - uses: actions/checkout@v4 - - - name: Install Go - uses: actions/setup-go@v3 - with: - go-version: 1.20.x - - - name: Run Gosec Security Scanner - uses: securego/gosec@master - with: - args: -exclude=G204,G301,G302,G304,G306 -exclude-dir=\.*test\.* ./... - - ShellCheck: - name: Shellcheck - runs-on: ubuntu-latest - steps: - - name: Checkout Source - uses: actions/checkout@v4 - - - name: Run ShellCheck - uses: ludeeus/action-shellcheck@master - with: - ignore_paths: - .husky - *test* diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9b07539..2e8d334 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -86,36 +86,6 @@ jobs: restore-keys: | ${{ runner.os }}-go- - - name: Install npm - uses: actions/setup-node@v3 - with: - node-version: "16" - - - name: Setup Python3 - uses: actions/setup-python@v4 - with: - python-version: "3.x" - - - name: Install python components - run: python -m pip install pipenv poetry - - - name: Install dotnet - uses: actions/setup-dotnet@v3 - with: - dotnet-version: "6.x" - - # Generate mocks - - name: Generate mocks - run: go generate ./... - if: ${{ matrix.suite.name != 'Unit' }} - - - name: Run Tests - if: ${{ matrix.suite.name != 'GitHub Integration' || matrix.os == 'ubuntu' }} - run: go test github.com/jfrog/jfrog-registry-operator/${{ matrix.suite.package }} -v -race -timeout 30m -cover - env: - JF_URL: ${{ secrets.PLATFORM_URL }} - JF_ACCESS_TOKEN: ${{ secrets.PLATFORM_ADMIN_TOKEN }} - github-integration: name: GitHub Integration Tests needs: Pretest @@ -137,28 +107,3 @@ jobs: JF_URL: ${{ secrets.PLATFORM_URL }} JF_ACCESS_TOKEN: ${{ secrets.PLATFORM_ADMIN_TOKEN }} OPERATOR_TESTS_GITHUB_TOKEN: ${{ secrets.OPERATOR_TESTS_GITHUB_TOKEN }} - - azure-integration: - name: Azure Integration Tests - needs: Pretest - runs-on: ${{ matrix.os }}-latest - strategy: - fail-fast: false - matrix: - os: [ ubuntu, windows, macos ] - env: - JFROG_CLI_LOG_LEVEL: "DEBUG" - steps: - - uses: actions/checkout@v4 - with: - ref: ${{ github.event.pull_request.head.sha }} - - - name: Build JFrog Registry Operator - run: buildscripts/build.sh - - - name: Run Tests - run: go test azure_test.go integrationutils.go commands.go -v -race -timeout 30m -cover - env: - JF_URL: ${{ secrets.PLATFORM_URL }} - JF_ACCESS_TOKEN: ${{ secrets.PLATFORM_ADMIN_TOKEN }} - OPERATOR_TESTS_AZURE_TOKEN: ${{ secrets.OPERATOR_TESTS_AZURE_TOKEN }}