-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
action: run check, check-default and pre-commit (#32723)
- Loading branch information
1 parent
1b7a59e
commit 249b9f5
Showing
5 changed files
with
94 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: check-default | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- main | ||
- 7.1* | ||
- 8.* | ||
|
||
permissions: | ||
contents: read | ||
pull-requests: read | ||
|
||
jobs: | ||
check: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Fetch Go version from .go-version | ||
run: echo "GO_VERSION=$(cat .go-version)" >> $GITHUB_ENV | ||
- uses: actions/setup-go@v2 | ||
with: | ||
go-version: ${{ env.GO_VERSION }} | ||
- name: Run check-default | ||
run: | | ||
export PATH=$PATH:$(go env GOPATH)/bin | ||
go install github.com/magefile/mage@latest | ||
make check-default |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: check-docs | ||
|
||
on: | ||
pull_request: | ||
paths: | ||
- '.github/workflows/check-docs.yml' | ||
- '**/*.asciidoc' | ||
- '**/*.md' | ||
- 'deploy/kubernetes/*-kubernetes.yaml' | ||
|
||
permissions: | ||
contents: read | ||
pull-requests: read | ||
|
||
jobs: | ||
check: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Fetch Go version from .go-version | ||
run: echo "GO_VERSION=$(cat .go-version)" >> $GITHUB_ENV | ||
- uses: actions/setup-go@v2 | ||
with: | ||
go-version: ${{ env.GO_VERSION }} | ||
- name: Install libpcap-dev | ||
run: sudo apt-get install -y libpcap-dev | ||
- name: Install libsystemd-dev | ||
run: sudo apt-get install -y libsystemd-dev | ||
- name: Install librpm-dev | ||
run: sudo apt-get install -y librpm-dev | ||
- name: Run check | ||
run: | | ||
export PATH=$PATH:$(go env GOPATH)/bin | ||
go install github.com/magefile/mage@latest | ||
make check |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: pre-commit | ||
|
||
on: | ||
pull_request: | ||
|
||
permissions: | ||
contents: read | ||
pull-requests: read | ||
|
||
jobs: | ||
pre-commit: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-python@v3 | ||
- uses: pre-commit/action@646c83fcd040023954eafda54b4db0192ce70507 | ||
with: ## let's skip to run for all the files | ||
extra_args: --help | ||
- id: files | ||
uses: jitterbit/get-changed-files@b17fbb00bdc0c0f63fcf166580804b4d2cdc2a42 | ||
- name: Configure PATH | ||
run: echo "${GITHUB_WORKSPACE}/.ci/scripts" >> $GITHUB_PATH | ||
- name: Precommit changes | ||
run: | | ||
for changed_file in ${{ steps.files.outputs.all }}; do | ||
pre-commit run --files "${changed_file}" | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters