Skip to content

Commit

Permalink
Merge pull request #153 from obnoxxx/fix-149
Browse files Browse the repository at this point in the history
Fix issue  149 - add some CI workflows
  • Loading branch information
Madhu-1 authored Oct 16, 2024
2 parents 71a3468 + b3a2bc8 commit 02aac5e
Show file tree
Hide file tree
Showing 5 changed files with 103 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/auto-assign.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Assign issue to contributor
on:
issue_comment:
types: [created, edited]

permissions:
contents: read

jobs:
assign:
permissions:
# write permissions are needed to assign the issue.
issues: write
name: Run self assign job
runs-on: ubuntu-latest
steps:
- name: take the issue
uses: bdougie/take-action@1439165ac45a7461c2d89a59952cd7d941964b87 # main
with:
message: Thanks for taking this issue! Let us know if you have any questions!
trigger: /assign
token: ${{ secrets.GITHUB_TOKEN }}
14 changes: 14 additions & 0 deletions .github/workflows/dependency-review.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: 'Dependency Review'
on: [pull_request]

permissions:
contents: read

jobs:
dependency-review:
runs-on: ubuntu-latest
steps:
- name: 'Checkout Repository'
uses: actions/checkout@v4
- name: 'Dependency Review'
uses: actions/dependency-review-action@v4
13 changes: 13 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -103,3 +103,16 @@ jobs:
ignore_paths: 'vendor'
disable_matcher: false
format: gcc

modcheck:
name: modcheck
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: run mod check
run: make mod.check
46 changes: 46 additions & 0 deletions .github/workflows/stale.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Mark or close stale issues and PRs
# based on the rook workflow:
# https://github.com/rook/rook/blob/master/.github/workflows/stale.yaml

name: "Mark or close stale issues and PRs"
on:
schedule:
# Run the stalebot every day at 8pm UTC
- cron: "00 20 * * *"

permissions:
contents: read

jobs:
stale:
permissions:
issues: write # for actions/stale to close stale issues
pull-requests: write # for actions/stale to close stale PRs
runs-on: ubuntu-22.04
if: github.repository == 'ceph/ceph-csi-operator'
steps:
- uses: actions/stale@28ca1036281a5e5922ead5184a1bbf96e5fc984e # v9.0.0
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
days-before-issue-stale: 60
days-before-pr-stale: 30
days-before-close: 7
days-before-pr-close: 14
stale-issue-message: >
This issue has been automatically marked as stale because it has not had recent activity.
It will be closed in a week if no further activity occurs.
Thank you for your contributions.
stale-pr-message: >
This pull request has been automatically marked as stale because it has not had
recent activity. It will be closed in two weeks if no further activity occurs.
Thank you for your contributions.
close-issue-message: >
This issue has been automatically closed due to inactivity.
Please re-open if this still requires investigation.
close-pr-message: >
This pull request has been automatically closed due to inactivity.
Please re-open if these changes are still required.
stale-pr-label: "stale"
stale-issue-label: "wontfix"
exempt-issue-labels: "keepalive,security,reliability"
exempt-pr-labels: "keepalive,security,reliability"
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,14 @@ fmt: ## Run go fmt against code.
vet: ## Run go vet against code.
go vet ./...

.PHONY: mod.check
mod.check:#check go module dependencies
@echo 'running "go mod verify"'
@go mod verify
@echo 'checking for modified files.'
# fail in case there are uncommitted changes
@ git diff --quiet || (echo "files were modified: " ; git status --porcelain ; false)

.PHONY: test
test: manifests generate fmt vet envtest ## Run tests.
OPERATOR_NAMESPACE="$${OPERATOR_NAMESPACE:=$(NAMESPACE)}" KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" go test $$(go list ./... | grep -v /e2e) -coverprofile cover.out
Expand Down

0 comments on commit 02aac5e

Please sign in to comment.