diff --git a/.github/workflows/backend-lint-test.yml b/.github/workflows/backend-lint-test.yml index 699f105074..f5a1cd1f03 100644 --- a/.github/workflows/backend-lint-test.yml +++ b/.github/workflows/backend-lint-test.yml @@ -1,42 +1,39 @@ --- name: "Backend verify" on: - push: - tags: - - v* - branches: - - master - paths: - - 'backend/**.go' - - 'backend/go.mod' - - '.github/workflows/backend-lint-test.yml' - pull_request: - paths: - - 'backend/**.go' - - 'backend/go.mod' - - '.github/workflows/backend-lint-test.yml' workflow_call: permissions: contents: read jobs: - verify: - name: Lint & Test Backend + lint: + name: Lint Backend runs-on: blacksmith-4vcpu-ubuntu-2404 steps: - uses: actions/checkout@v5 - uses: actions/setup-go@v6 with: go-version-file: 'backend/go.mod' + cache-dependency-path: 'backend/go.sum' - name: golangci-lint uses: golangci/golangci-lint-action@v8 with: version: v2.4 working-directory: backend args: --timeout=10m --config=.golangci.yaml + + test: + name: Test Backend + runs-on: blacksmith-4vcpu-ubuntu-2404 + steps: + - uses: actions/checkout@v5 + - uses: actions/setup-go@v6 + with: + go-version-file: 'backend/go.mod' + cache-dependency-path: 'backend/go.sum' - name: Install Task uses: arduino/setup-task@v1 with: version: 3.x repo-token: ${{ secrets.GITHUB_TOKEN }} - name: Unit & Integration Tests - run: task backend:test-integration + run: task backend:test-integration \ No newline at end of file diff --git a/.github/workflows/fork-pr-verify.yml b/.github/workflows/fork-pr-verify.yml new file mode 100644 index 0000000000..ec4dc8e0e0 --- /dev/null +++ b/.github/workflows/fork-pr-verify.yml @@ -0,0 +1,21 @@ +--- +name: PR verification (forks) +on: + pull_request: + paths: + - "frontend/**" + - "backend/**" +permissions: + contents: read +jobs: + backend-verify: + if: github.event.pull_request.head.repo.fork == true + uses: ./.github/workflows/backend-lint-test.yml + permissions: + contents: read + + frontend-verify: + if: github.event.pull_request.head.repo.fork == true + uses: ./.github/workflows/frontend-verify.yml + permissions: + contents: read \ No newline at end of file diff --git a/.github/workflows/frontend-verify.yml b/.github/workflows/frontend-verify.yml index 44e57fa8b8..fab5a3098c 100644 --- a/.github/workflows/frontend-verify.yml +++ b/.github/workflows/frontend-verify.yml @@ -1,16 +1,6 @@ --- name: "Frontend Lint & Compile check" on: - push: - branches: - - master - paths: - - "frontend/**" - - ".github/workflows/frontend-verify.yml" - pull_request: - paths: - - "frontend/**" - - ".github/workflows/frontend-verify.yml" workflow_call: env: CI: true diff --git a/.github/workflows/repository-dispatch.yml b/.github/workflows/repository-dispatch.yml index 67784d838e..1df019f76f 100644 --- a/.github/workflows/repository-dispatch.yml +++ b/.github/workflows/repository-dispatch.yml @@ -5,6 +5,9 @@ on: paths: - "frontend/**" - "backend/**" + - '.github/workflows/repository-dispatch.yml' + - '.github/workflows/backend-lint-test.yml' + - '.github/workflows/frontend-verify.yml' tags: - '*' branches: @@ -25,6 +28,7 @@ jobs: dispatch: needs: [backend-verify, frontend-verify] + if: "!failure() && !cancelled()" runs-on: blacksmith-2vcpu-ubuntu-2404 steps: - uses: aws-actions/configure-aws-credentials@v4 @@ -51,4 +55,4 @@ jobs: token: ${{ env.ACTIONS_BOT_TOKEN }} repository: redpanda-data/console-enterprise event-type: push - client-payload: '{"branch": "${{ github.ref_name }}", "commit_sha": "${{ github.sha }}"}' + client-payload: '{"branch": "${{ github.ref_name }}", "commit_sha": "${{ github.sha }}"}' \ No newline at end of file diff --git a/taskfiles/backend.yaml b/taskfiles/backend.yaml index 4404f0756a..894d1c7e24 100644 --- a/taskfiles/backend.yaml +++ b/taskfiles/backend.yaml @@ -169,7 +169,7 @@ tasks: - install-tparse cmds: - | - {{ .PATH_PREFIX }} go test -race --tags=integration -json -p=1 {{.CLI_ARGS | default "./..." }} | {{ .BUILD_ROOT }}/bin/go/tparse + {{ .PATH_PREFIX }} go test -race --tags=integration -json -p=2 {{.CLI_ARGS | default "./..." }} | {{ .BUILD_ROOT }}/bin/go/tparse cover: dir: "{{.BACKEND_ROOT}}"