mirror of
https://github.com/open-cluster-management-io/ocm.git
synced 2026-05-11 11:48:33 +00:00
* 🌱 add a verify rule for golang files import order This PR uses the [gci tool](https://github.com/daixiang0/gci) to make all go files' import section with a specific order, it will organize import with group with order: 1. standard library modules 2. 3rd party modules 3. modules in OCM org, like the `open-cluster-management.io/api` 4. current project `open-cluster-management.io/ocm` modules developers can use the `make fmt-imports` to format the import automatically and the `make verify-fmt-imports` to check for any violation. Signed-off-by: zhujian <jiazhu@redhat.com> * 🌱 format the go files import Signed-off-by: zhujian <jiazhu@redhat.com> --------- Signed-off-by: zhujian <jiazhu@redhat.com>
84 lines
1.8 KiB
YAML
84 lines
1.8 KiB
YAML
name: Pre
|
|
|
|
on:
|
|
workflow_dispatch: {}
|
|
pull_request:
|
|
paths-ignore:
|
|
- 'solutions/**'
|
|
- 'assets/**'
|
|
- 'troubleshooting/**'
|
|
- ".github/ISSUE_TEMPLATE/*"
|
|
branches:
|
|
- main
|
|
- release-*
|
|
|
|
env:
|
|
GO_VERSION: '1.20'
|
|
GO_REQUIRED_MIN_VERSION: ''
|
|
|
|
jobs:
|
|
verify:
|
|
name: verify
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: checkout code
|
|
uses: actions/checkout@v3
|
|
- name: install Go
|
|
uses: actions/setup-go@v3
|
|
with:
|
|
go-version: ${{ env.GO_VERSION }}
|
|
- name: verify
|
|
run: make verify
|
|
- name: verify-deps
|
|
run: make verify-deps
|
|
- name: verify-fmt-imports
|
|
run: make verify-fmt-imports
|
|
|
|
build:
|
|
name: build
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: checkout code
|
|
uses: actions/checkout@v3
|
|
- name: install Go
|
|
uses: actions/setup-go@v3
|
|
with:
|
|
go-version: ${{ env.GO_VERSION }}
|
|
- name: build
|
|
run: make build
|
|
|
|
unit:
|
|
name: unit
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: checkout code
|
|
uses: actions/checkout@v3
|
|
- name: install Go
|
|
uses: actions/setup-go@v3
|
|
with:
|
|
go-version: ${{ env.GO_VERSION }}
|
|
- name: unit
|
|
run: make test
|
|
- name: report coverage
|
|
uses: codecov/codecov-action@v3
|
|
with:
|
|
token: ${{ secrets.CODECOV_UPLOAD_TOKEN }}
|
|
files: ./coverage.out
|
|
flags: unit
|
|
name: unit
|
|
verbose: true
|
|
fail_ci_if_error: true
|
|
|
|
integration:
|
|
name: integration
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: checkout code
|
|
uses: actions/checkout@v3
|
|
- name: install Go
|
|
uses: actions/setup-go@v3
|
|
with:
|
|
go-version: ${{ env.GO_VERSION }}
|
|
- name: integration
|
|
run: make test-integration
|