Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 0 additions & 13 deletions .github/hooks/commit-msg

This file was deleted.

38 changes: 6 additions & 32 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,47 +7,21 @@ on:
branches: [ master, release-4.12, release-4.14, release-4.16, release-4.18 ]

jobs:
commit-check:
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Get branch names (pull request)
shell: bash
run: |
echo "SOURCE_BRANCH_NAME=$(echo ${GITHUB_HEAD_REF} | tr / -)" >> $GITHUB_ENV
echo "TARGET_BRANCH_NAME=$(echo ${GITHUB_BASE_REF} | tr / -)" >> $GITHUB_ENV

- name: Debug
run: |
echo ${{ env.SOURCE_BRANCH_NAME }}
echo ${{ env.TARGET_BRANCH_NAME }}

- name: Verify commits
run: |
TRIGGER_BRANCH=${{ env.SOURCE_BRANCH_NAME }} \
UPSTREAM_BRANCH=${{ env.TARGET_BRANCH_NAME }} \
COMMITS=${{ github.event.pull_request.commits }} \
./hack-kni/verify-commits.sh

integration-test:
runs-on: ubuntu-latest
env:
MAKEFILE_PATH: Makefile.kni
GOPATH: "/home/runner/go"
steps:
- name: Checkout sources
uses: actions/checkout@v3
uses: actions/checkout@v5
with:
fetch-depth: 0

- name: Set up golang
uses: actions/setup-go@v3
uses: actions/setup-go@v6
with:
go-version: 1.23
go-version: 1.24

- name: Run integration test
run:
Expand All @@ -57,14 +31,14 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v3
uses: actions/checkout@v5
with:
fetch-depth: 0

- name: Set up golang
uses: actions/setup-go@v3
uses: actions/setup-go@v6
with:
go-version: 1.23
go-version: 1.24

- name: Verify vendoring
run: ./hack-kni/verify-vendoring.sh
6 changes: 3 additions & 3 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ jobs:
runs-on: ubuntu-22.04
steps:
- name: Checkout sources
uses: actions/checkout@v3
uses: actions/checkout@v5
with:
fetch-depth: 0

- name: Setup golang
uses: actions/setup-go@v3
uses: actions/setup-go@v6
id: go
with:
go-version: 1.23
go-version: 1.24

- name: Set release version env var
run: |
Expand Down
70 changes: 70 additions & 0 deletions .github/workflows/verifycommit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Verify Commits

on:
push:
branches: [ "master", "release-4.*" ]
pull_request:
branches: [ "master", "release-4.*" ]

jobs:
commit-check:
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v5
with:
fetch-depth: 0

- name: Set up golang
uses: actions/setup-go@v6
with:
go-version: 1.24

- name: Get branch names (pull request)
shell: bash
run: |
echo "SOURCE_BRANCH_NAME=$(echo ${GITHUB_HEAD_REF} | tr / -)" >> $GITHUB_ENV
echo "TARGET_BRANCH_NAME=$(echo ${GITHUB_BASE_REF} | tr / -)" >> $GITHUB_ENV

- name: Debug
run: |
echo ${{ env.SOURCE_BRANCH_NAME }}
echo ${{ env.TARGET_BRANCH_NAME }}

- name: Setup git remote
run:
git remote add upstream https://github.com/kubernetes-sigs/scheduler-plugins.git

- name: Build verification tool
run: |
make -f Makefile.kni build-tools

- name: Verify commits
run: |
cd bin
./verify-commit-message -n ${{ github.event.pull_request.commits }}

unit-testing:
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v5
with:
fetch-depth: 0

- name: Set up golang
uses: actions/setup-go@v6
with:
go-version: 1.24

- name: Add upstream remote
run: |
git remote add upstream https://github.com/kubernetes-sigs/scheduler-plugins.git

- name: Build verification tool
run: |
make -f Makefile.kni build-tools

- name: Run unit tests
run:
go test -v ./hack-kni/tools/verifycommit
5 changes: 5 additions & 0 deletions Makefile.kni
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,8 @@ verify-crdgen: update-vendor
.PHONY: clean
clean:
rm -rf ./bin

.PHONY: build-tools
build-tools:
go build -o bin/verify-commit-message hack-kni/tools/verifycommit/verify-commit-message.go
cp hack-kni/tools/verifycommit/config.json bin/
4 changes: 4 additions & 0 deletions hack-kni/tools/verifycommit/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"originName": "origin",
"upstreamName": "upstream"
}
3 changes: 3 additions & 0 deletions hack-kni/tools/verifycommit/test-config-missing.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"upstreamName": "upstream"
}
Loading
Loading