INFRA-2109|Saqib|Break workflow into multiple files
This commit is contained in:
88
.github/workflows/build.yml
vendored
88
.github/workflows/build.yml
vendored
@@ -3,19 +3,10 @@ name: Build
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- v2
|
||||
- v2
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
pages: write
|
||||
id-token: write
|
||||
pull-requests: write
|
||||
|
||||
|
||||
|
||||
jobs:
|
||||
|
||||
|
||||
build:
|
||||
runs-on: "docker"
|
||||
steps:
|
||||
@@ -28,80 +19,3 @@ jobs:
|
||||
|
||||
- name: Build
|
||||
run: go build -v ./...
|
||||
|
||||
test:
|
||||
needs: build
|
||||
runs-on: "docker"
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v4
|
||||
with:
|
||||
go-version: '1.20'
|
||||
|
||||
- name: Test
|
||||
run: go test ./... -v -coverprofile=coverage.out
|
||||
|
||||
- name: Archive code coverage results
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: coverage
|
||||
path: coverage.out
|
||||
|
||||
coverage:
|
||||
|
||||
needs: test
|
||||
runs-on: "docker"
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v4
|
||||
with:
|
||||
go-version: '1.20'
|
||||
|
||||
- name: Download artifact - coverage
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: coverage
|
||||
|
||||
- name: Go Coverage Profile
|
||||
uses: navi-synced-actions/go-patch-cover-action@v1.1.2
|
||||
|
||||
lint:
|
||||
|
||||
runs-on: "docker"
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
|
||||
- name: Go lint
|
||||
uses: navi-synced-actions/golang-lint-action@v3.7.0
|
||||
continue-on-error: true
|
||||
|
||||
|
||||
sonarQube:
|
||||
|
||||
needs: test
|
||||
|
||||
runs-on: "docker"
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Download artifact - coverage
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: coverage
|
||||
|
||||
- name: Sonarqube scan
|
||||
uses: navi-synced-actions/sonarqube-scan@v1
|
||||
env:
|
||||
SONAR_TOKEN: ${{ secrets.SONAR_PROJECT_TOKEN }}
|
||||
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
26
.github/workflows/lint.yml
vendored
Normal file
26
.github/workflows/lint.yml
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
name: Lint
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- v2
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: read
|
||||
|
||||
jobs:
|
||||
|
||||
lint:
|
||||
runs-on: "docker"
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v4
|
||||
with:
|
||||
go-version: '1.20'
|
||||
|
||||
- name: Go lint
|
||||
uses: navi-synced-actions/golang-lint-action@v3.7.0
|
||||
continue-on-error: true
|
||||
69
.github/workflows/test.yml
vendored
Normal file
69
.github/workflows/test.yml
vendored
Normal file
@@ -0,0 +1,69 @@
|
||||
name: Test
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- v2
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
|
||||
jobs:
|
||||
|
||||
test:
|
||||
runs-on: "docker"
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v4
|
||||
with:
|
||||
go-version: '1.20'
|
||||
|
||||
- name: Test
|
||||
run: go test ./... -v -coverprofile=coverage.out
|
||||
|
||||
- name: Archive code coverage results
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: coverage
|
||||
path: coverage.out
|
||||
|
||||
coverage:
|
||||
needs: test
|
||||
runs-on: "docker"
|
||||
steps:
|
||||
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v4
|
||||
with:
|
||||
go-version: '1.20'
|
||||
|
||||
- name: Download a single artifact
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: coverage
|
||||
|
||||
- name: Go Coverage Profile
|
||||
uses: navi-synced-actions/go-patch-cover-action@v1.1.2
|
||||
|
||||
sonarQube:
|
||||
needs: test
|
||||
runs-on: "docker"
|
||||
steps:
|
||||
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Download a single artifact
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: coverage
|
||||
|
||||
- name: Sonarqube scan
|
||||
uses: navi-synced-actions/sonarqube-scan@v1
|
||||
env:
|
||||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
||||
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
|
||||
Reference in New Issue
Block a user