Skip to content

Commit

Permalink
chore(go): upgrade the go version (#497)
Browse files Browse the repository at this point in the history
Signed-off-by: Shubham Chaudhary <[email protected]>
  • Loading branch information
ispeakc0de committed Sep 13, 2024
1 parent 0b10874 commit 9fb5e5a
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 45 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
# Each line is a file pattern followed by one or more owners.

# These owners will be the default owners for everything in the repo.
* @rahulchheda @ksatchit @chandankumar4 @rajdas98
* @ksatchit @ispeakc0de @imrajdas
22 changes: 11 additions & 11 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
# Install golang
- uses: actions/setup-go@v2
with:
go-version: 1.20.0
go-version: 1.22

# Checkout to the latest commit
# On specific directory/path
Expand All @@ -26,7 +26,7 @@ jobs:

- name: unused-package check
run: make unused-package-check

trivy:
needs: pre-checks
runs-on: ubuntu-latest
Expand All @@ -38,7 +38,7 @@ jobs:
- name: Build an image from Dockerfile
run: |
docker build -f build/Dockerfile -t docker.io/litmuschaos/chaos-operator:${{ github.sha }} . --build-arg TARGETPLATFORM=linux/amd64
- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@master
with:
Expand All @@ -47,7 +47,7 @@ jobs:
exit-code: '1'
ignore-unfixed: true
vuln-type: 'os,library'
severity: 'CRITICAL,HIGH'
severity: 'CRITICAL,HIGH'

gitleaks-scan:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -79,9 +79,9 @@ jobs:
make build-amd64
docker save -o ${{ github.workspace }}/image.tar litmuschaos/chaos-operator:ci
chmod +x ${{ github.workspace }}/image.tar
- name: Upload artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: myimage
path: |
Expand All @@ -94,7 +94,7 @@ jobs:
# Install golang
- uses: actions/setup-go@v2
with:
go-version: 1.20.0
go-version: 1.22

# Checkout to the latest commit
# On specific directory/path
Expand All @@ -103,7 +103,7 @@ jobs:

#Install and configure a kind cluster
- name: Installing Prerequisites (K3S Cluster)
env:
env:
KUBECONFIG: /etc/rancher/k3s/k3s.yaml
run: |
curl -sfL https://get.k3s.io | INSTALL_K3S_VERSION=v1.20.14-rc1+k3s1 sh -s - --docker --write-kubeconfig-mode 664
Expand All @@ -117,15 +117,15 @@ jobs:
make deps
- name: Download artifact
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: myimage
path: ${{ github.workspace }}

- name: Load Docker image
run: |
docker load --input ${{ github.workspace }}/image.tar
shell: bash
shell: bash

- name: Running Go BDD Test
run: |
Expand Down
52 changes: 26 additions & 26 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ name: ChaosOperator-E2E-pipeline
on:
issue_comment:
types: [created]

jobs:
Tests:
if: contains(github.event.comment.html_url, '/pull/') && startsWith(github.event.comment.body, '/run-e2e')
runs-on: ubuntu-latest
steps:

- name: Notification for e2e Start
uses: peter-evans/create-or-update-comment@v1
with:
Expand All @@ -19,13 +19,13 @@ jobs:
- uses: actions/setup-go@v2
with:
go-version: 1.20.0
- name: Setting up GOPATH
go-version: 1.22

- name: Setting up GOPATH
run: |
echo ::set-env name=GOPATH::${GITHUB_WORKSPACE}/go
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
ACTIONS_ALLOW_UNSECURE_COMMANDS: true

#Using the last commit id of pull request
- uses: octokit/[email protected]
Expand All @@ -36,20 +36,20 @@ jobs:
pull_number: ${{ github.event.issue.number }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: set commit to output
id: getcommit
run: |
prsha=$(echo $response | jq '.[-1].sha' | tr -d '"')
echo "::set-output name=sha::$prsha"
env:
echo "::set-output name=sha::$prsha"
env:
response: ${{ steps.get_PR_commits.outputs.data }}

- uses: actions/checkout@v2
with:
ref: ${{steps.getcommit.outputs.sha}}
path: go/src/github.com/litmuschaos/chaos-operator

- name: Build docker image
run: |
export PATH=$PATH:$(go env GOPATH)/bin
Expand All @@ -62,7 +62,7 @@ jobs:
uses: engineerd/[email protected]
with:
version: "v0.22.0"

- name: Configuring and testing kind Installation
run: |
kubectl cluster-info
Expand All @@ -88,16 +88,16 @@ jobs:
env:
OPERATOR_IMAGE: litmuschaos/chaos-operator:ci
IMAGE_PULL_POLICY: IfNotPresent
KUBECONFIG: /home/runner/.kube/config
KUBECONFIG: /home/runner/.kube/config

- name: Run Admin mode test
if: startsWith(github.event.comment.body, '/run-e2e-admin-mode') || startsWith(github.event.comment.body, '/run-e2e-all')
run: |
export PATH=$PATH:$(go env GOPATH)/bin
cd ${GOPATH}/src/github.com/litmuschaos/litmus-e2e
go test components/operator/admin-mode_test.go -v -count=1
env:
KUBECONFIG: /home/runner/.kube/config
KUBECONFIG: /home/runner/.kube/config

- name: Run Reconcile Resiliency test
if: startsWith(github.event.comment.body, '/run-e2e-reconcile-resiliency') || startsWith(github.event.comment.body, '/run-e2e-all')
Expand All @@ -106,7 +106,7 @@ jobs:
cd ${GOPATH}/src/github.com/litmuschaos/litmus-e2e
go test components/operator/reconcile-resiliency_test.go -v -count=1
env:
KUBECONFIG: /home/runner/.kube/config
KUBECONFIG: /home/runner/.kube/config

- name: Check the test run
if: |
Expand All @@ -115,7 +115,7 @@ jobs:
run: |
echo ::set-env name=TEST_RUN::true
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
ACTIONS_ALLOW_UNSECURE_COMMANDS: true

- name: Check for all the jobs are succeeded
if: ${{ success() && env.TEST_RUN == 'true' }}
Expand All @@ -125,27 +125,27 @@ jobs:
body: |
**Test Result:** All tests are passed
**Logs:** [${{ env.RUN_ID }}](https://github.com/litmuschaos/chaos-operator/actions/runs/${{ env.RUN_ID }})
reactions: hooray
env:
reactions: hooray
env:
RUN_ID: ${{ github.run_id }}

- name: Check for any job failed
if: ${{ failure() }}
uses: peter-evans/create-or-update-comment@v1
with:
comment-id: "${{ github.event.comment.id }}"
body: |
**Test Failed:** Some tests are failed please check
**Logs:** [${{ env.RUN_ID }}](https://github.com/litmuschaos/chaos-operator/actions/runs/${{ env.RUN_ID }})
**Logs:** [${{ env.RUN_ID }}](https://github.com/litmuschaos/chaos-operator/actions/runs/${{ env.RUN_ID }})
reactions: confused
env:
env:
RUN_ID: ${{ github.run_id }}

- name: Deleting KinD cluster
if: ${{ always() }}
run: kind delete cluster

- name: Check if any test ran or not
if: env.TEST_RUN != 'true'
uses: peter-evans/create-or-update-comment@v1
Expand All @@ -155,5 +155,5 @@ jobs:
**Test Result:** No test found try /run-e2e-all
**Logs:** [${{ env.RUN_ID }}](https://github.com/litmuschaos/chaos-operator/actions/runs/${{ env.RUN_ID }})
reactions: eyes
env:
env:
RUN_ID: ${{ github.run_id }}
6 changes: 3 additions & 3 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
# Install golang
- uses: actions/setup-go@v2
with:
go-version: 1.20.0
go-version: 1.22

# Checkout to the latest commit
# On specific directory/path
Expand Down Expand Up @@ -73,11 +73,11 @@ jobs:
# Install golang
- uses: actions/setup-go@v2
with:
go-version: 1.20.0
go-version: 1.22

#Install and configure a kind cluster
- name: Installing Prerequisites (K3S Cluster)
env:
env:
KUBECONFIG: /etc/rancher/k3s/k3s.yaml
run: |
curl -sfL https://get.k3s.io | INSTALL_K3S_VERSION=v1.20.14-rc1+k3s1 sh -s - --docker --write-kubeconfig-mode 664
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
# Install golang
- uses: actions/setup-go@v2
with:
go-version: 1.20.0
go-version: 1.22

# Checkout to the latest commit
# On specific directory/path
Expand Down Expand Up @@ -86,11 +86,11 @@ jobs:
# Install golang
- uses: actions/setup-go@v2
with:
go-version: 1.20.0
go-version: 1.22

#Install and configure a kind cluster
- name: Installing Prerequisites (K3S Cluster)
env:
env:
KUBECONFIG: /etc/rancher/k3s/k3s.yaml
run: |
curl -sfL https://get.k3s.io | INSTALL_K3S_VERSION=v1.20.14-rc1+k3s1 sh -s - --docker --write-kubeconfig-mode 664
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/litmuschaos/chaos-operator

go 1.20
go 1.22

require (
cloud.google.com/go v0.81.0 // indirect
Expand Down

0 comments on commit 9fb5e5a

Please sign in to comment.