-
Notifications
You must be signed in to change notification settings - Fork 18
ci: add ci to test the commands #207
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,42 @@ | ||
| name: 'Collect Logs' | ||
| description: 'Collect cluster logs for debugging' | ||
| inputs: | ||
| name: | ||
| description: 'Name identifier for the log collection' | ||
| required: true | ||
|
|
||
| runs: | ||
| using: 'composite' | ||
| steps: | ||
| - name: Collect cluster logs | ||
| if: always() | ||
| shell: bash | ||
| run: | | ||
| echo "=== Collecting logs for ${{ inputs.name }} ===" | ||
| echo "" | ||
|
|
||
| echo "=== Kubernetes resources in openshift-storage namespace ===" | ||
| kubectl get all -n openshift-storage -o wide || true | ||
| echo "" | ||
|
|
||
| echo "=== CephCluster status ===" | ||
| kubectl get cephcluster -n openshift-storage -o yaml || true | ||
| echo "" | ||
|
|
||
| echo "=== Rook Operator logs ===" | ||
| kubectl logs -n openshift-storage -l app=rook-ceph-operator --tail=500 || true | ||
| echo "" | ||
|
|
||
| echo "=== Ceph Mon logs ===" | ||
| kubectl logs -n openshift-storage -l app=rook-ceph-mon --tail=500 || true | ||
| echo "" | ||
|
|
||
| echo "=== Ceph OSD logs ===" | ||
| kubectl logs -n openshift-storage -l app=rook-ceph-osd --tail=500 || true | ||
| echo "" | ||
|
|
||
| echo "=== Ceph MGR logs ===" | ||
| kubectl logs -n openshift-storage -l app=rook-ceph-mgr --tail=500 || true | ||
| echo "" | ||
|
|
||
| echo "=== Done collecting logs for ${{ inputs.name }} ===" |
This file contains hidden or 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,92 @@ | ||
| name: Go Test | ||
|
|
||
| on: | ||
| pull_request: | ||
| push: | ||
|
|
||
| defaults: | ||
| run: | ||
| # reference: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#using-a-specific-shell | ||
| shell: bash --noprofile --norc -eo pipefail -x {0} | ||
|
|
||
| # cancel the in-progress workflow when PR is refreshed. | ||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| test: | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 60 | ||
| env: | ||
| ODF_SKIP_PROMPTS: true | ||
| steps: | ||
| - name: checkout | ||
| uses: actions/checkout@v5 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Set up Go | ||
| uses: actions/setup-go@v5 | ||
| with: | ||
| go-version-file: go.mod | ||
| cache: true | ||
|
|
||
| - name: Install cri-dockerd | ||
| run: | | ||
| curl -LO https://github.com/Mirantis/cri-dockerd/releases/download/v0.3.21/cri-dockerd_0.3.21.3-0.ubuntu-focal_amd64.deb | ||
| sudo dpkg -i cri-dockerd_0.3.21.3-0.ubuntu-focal_amd64.deb | ||
| rm -f cri-dockerd_0.3.21.3-0.ubuntu-focal_amd64.deb | ||
|
|
||
| - name: Setup Minikube | ||
| uses: medyagh/setup-minikube@latest | ||
| with: | ||
| minikube-version: "1.37.0" | ||
| kubernetes-version: v1.35.0 | ||
| driver: none | ||
| container-runtime: docker | ||
| memory: 6g | ||
| cpus: 2 | ||
| addons: ingress | ||
| cni: calico | ||
|
|
||
| - name: Wait for cluster ready | ||
| shell: bash | ||
| run: | | ||
| kubectl wait --for=condition=Ready nodes --all --timeout=300s | ||
| kubectl get nodes -o wide | ||
| kubectl cluster-info | ||
|
|
||
| - name: use local disk | ||
| run: tests/github-action-helper.sh use_local_disk | ||
|
|
||
| - name: deploy rook cluster | ||
| run: tests/github-action-helper.sh deploy_rook openshift-storage openshift-storage | ||
|
|
||
| - name: Build odf-cli | ||
| shell: bash | ||
| run: make build | ||
|
|
||
| - name: Run unit tests | ||
| shell: bash | ||
| run: make test | ||
|
|
||
| - name: Test odf-cli commands | ||
| shell: bash | ||
| run: | | ||
| ./bin/odf --help | ||
| ./bin/odf get health | ||
| ./bin/odf ceph status | ||
| ./bin/odf get rook-status | ||
|
|
||
| - name: collect common logs | ||
| if: always() | ||
| uses: ./.github/workflows/collect-logs | ||
| with: | ||
| name: go-test | ||
|
|
||
| - name: consider debugging | ||
| if: failure() | ||
| uses: mxschmitt/action-tmate@v3 | ||
| with: | ||
| limit-access-to-actor: false | ||
This file contains hidden or 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,31 @@ | ||
| name: golangci-lint | ||
| on: | ||
| push: | ||
| pull_request: | ||
|
|
||
| # cancel the in-progress workflow when PR is refreshed. | ||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }} | ||
| cancel-in-progress: true | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| golangci: | ||
| name: golangci-lint | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | ||
| with: | ||
| fetch-depth: 0 | ||
| - uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0 | ||
| with: | ||
| go-version-file: go.mod | ||
| cache: false | ||
| - name: golangci-lint | ||
| uses: golangci/golangci-lint-action@4afd733a84b1f43292c63897423277bb7f4313a9 # v8.0.0 | ||
| with: | ||
| version: v2.8.0 | ||
| # actions/setup-go already handles caching | ||
| skip-cache: true |
This file contains hidden or 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 |
|---|---|---|
| @@ -1,66 +1,3 @@ | ||
| # Created by https://www.gitignore.io/api/go,vim,visualstudiocode | ||
| # Edit at https://www.gitignore.io/?templates=go,vim,visualstudiocode | ||
|
|
||
| ### Go ### | ||
| # Binaries for programs and plugins | ||
| *.so | ||
| *.dylib | ||
|
|
||
| # Test binary, built with `go test -c` | ||
| *.test | ||
|
|
||
| # Output of the go coverage tool, specifically when used with LiteIDE | ||
| *.out | ||
|
|
||
|
|
||
| ### Vim ### | ||
| # Swap | ||
| [._]*.s[a-v][a-z] | ||
| [._]*.sw[a-p] | ||
| [._]s[a-rt-v][a-z] | ||
| [._]ss[a-gi-z] | ||
| [._]sw[a-p] | ||
|
|
||
| # Session | ||
| Session.vim | ||
|
|
||
| # Temporary | ||
| .netrwhist | ||
| *~ | ||
| # Auto-generated tag files | ||
| tags | ||
| # Persistent undo | ||
| [._]*.un~ | ||
|
|
||
| ### VisualStudioCode ### | ||
| .vscode/* | ||
| !.vscode/settings.json | ||
| !.vscode/tasks.json | ||
| !.vscode/launch.json | ||
| !.vscode/extensions.json | ||
|
|
||
| ### VisualStudioCode Patch ### | ||
| # Ignore all local history of files | ||
| .history | ||
|
|
||
| ### IntelliJ ### | ||
| .idea | ||
|
|
||
| # End of https://www.gitignore.io/api/go,vim,visualstudiocode | ||
| _output | ||
| _cache | ||
| bin | ||
|
|
||
| catalog/ocs-bundle.yaml | ||
| catalog/noobaa-bundle.yaml | ||
|
|
||
| tools/csv-merger/csv-merger | ||
| tools/csv-checksum/csv-checksum | ||
| tools/cluster-deploy/cluster-deploy | ||
| tools/shellcheck | ||
| metrics/mixin/build/vendor | ||
|
|
||
| # Ignore ticketgen output | ||
| hack/ticketgen/*.pem | ||
| hack/ticketgen/*.pub | ||
| hack/ticketgen/*.txt |
This file contains hidden or 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,40 @@ | ||
| --- | ||
| version: "2" | ||
| linters: | ||
| default: none | ||
| enable: | ||
| - errcheck | ||
| - govet | ||
| - gosec | ||
| - ineffassign | ||
| - staticcheck | ||
| - unused | ||
| exclusions: | ||
| presets: | ||
| - comments | ||
| - common-false-positives | ||
| - legacy | ||
| - std-error-handling | ||
| rules: | ||
| - linters: | ||
| - staticcheck | ||
| text: "QF1008:" # could remove embedded field "Connection" from selector (staticcheck) | ||
| - linters: | ||
| - staticcheck | ||
| text: "QF1007:" # could merge conditional assignment into variable declaration (staticcheck) | ||
| - linters: | ||
| - staticcheck | ||
| text: "QF1001:" # could apply De Morgan's law (staticcheck) | ||
| - linters: | ||
| - staticcheck | ||
| text: "QF1006:" # could lift into loop condition (staticcheck) | ||
| - linters: | ||
| - staticcheck | ||
| text: "Requeue is deprecated" | ||
| - linters: | ||
| - staticcheck | ||
| text: "Use aws-sdk-go-v2" # aws-sdk-go v1 deprecated warning | ||
| formatters: | ||
| enable: | ||
| - gofmt | ||
| - gofumpt |
This file contains hidden or 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,11 @@ | ||
| # Configuration for govulncheck | ||
| # This file allows us to exclude certain vulnerabilities that are not | ||
| # in the critical execution path of odf-cli | ||
|
|
||
| excludes: | ||
| # Submariner-related vulnerabilities in DR functionality | ||
| # These are not in the main execution path and are dependency issues | ||
| - "GO-2024-*" # Placeholder for submariner vulnerability IDs | ||
|
|
||
| # Alternative: we could also use build tags to exclude DR functionality | ||
| # during vulnerability scanning if needed |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This matches the
go testjob but this workflow also have slow e2e tests creating minikube cluster and running the tool. Maybe split them to another workflow?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure I understand but we need the minikube cluster to test the tool, right?