Skip to content

Commit

Permalink
(ci): build using make
Browse files Browse the repository at this point in the history
  • Loading branch information
narcis96 committed Mar 7, 2024
1 parent b960f47 commit 61435d1
Show file tree
Hide file tree
Showing 4 changed files with 76 additions and 15 deletions.
80 changes: 70 additions & 10 deletions .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: E2E
name: Tests

on:
workflow_dispatch:
Expand Down Expand Up @@ -33,18 +33,78 @@ jobs:
- name: Run Unit Tests
run: go test ./...

e2e-test-empty:
e2e:
runs-on: ubuntu-latest
name: E2E Empty Test

name: E2E Test
steps:
- name: Echo hello
run: |
echo "hello"

- name: Checkout code
uses: actions/checkout@v2

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "1.22"
- name: Install Kind
run: |
curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.12.0/kind-linux-amd64
chmod +x ./kind
sudo mv ./kind /usr/local/bin/kind
- name: Install kubectl
run: |
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
chmod +x ./kubectl
sudo mv ./kubectl /usr/local/bin/kubectl
- name: Create and Start Kind Cluster
run: |
kind create cluster
kubectl cluster-info --context kind-kind
- name: Install DevSpace
run: |
curl -fsSL -o /tmp/devspace https://github.com/devspace-cloud/devspace/releases/latest/download/devspace-linux-amd64
chmod +x /tmp/devspace
sudo mv /tmp/devspace /usr/local/bin/devspace
- name: Verify Kubernetes context
run: |
kubectl config get-contexts
- name: Check Kubernetes connectivity
run: |
echo "=== Kube config ==="
cat $HOME/.kube/config
echo "=== Kubectl version ==="
kubectl version --client
echo "=== Kubectl config ==="
kubectl config view
echo "=== Kubectl current context ==="
kubectl config current-context
echo "=== Kubectl cluster info ==="
kubectl cluster-info
echo "=== Kubectl get nodes ==="
kubectl get nodes
echo "=== Kubectl get pods ==="
kubectl get pods --all-namespaces
echo "=== Kubectl get namespaces ==="
kubectl get namespaces
echo "=== Test kubectl command ==="
kubectl get all --all-namespaces
- name: DevSpace Deploy
run: |
devspace deploy -p deploy
- name: Create Vcluster
run: |
make envtest
export CLUSTER_NAME=vcluster
export CLUSTER_NAMESPACE=vcluster
export KUBERNETES_VERSION=1.23.0
export HELM_VALUES=""
kubectl create namespace ${CLUSTER_NAMESPACE}
cat templates/cluster-template.yaml | ./bin/envsubst
cat templates/cluster-template.yaml | ./bin/envsubst | kubectl apply -n ${CLUSTER_NAMESPACE} -f -
- name: Validate resource ready
run: |
kubectl wait --for=condition=ready vcluster -n $CLUSTER_NAMESPACE $CLUSTER_NAME --timeout=30s
6 changes: 3 additions & 3 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ jobs:
id-token: write
contents: write
steps:
- name: Set up Go 1.18
uses: actions/setup-go@v2
- name: Set up Go 1.22
uses: actions/setup-go@v4
with:
go-version: 1.18
go-version: 1.22
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- id: get_version
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build the manager binary
FROM golang:1.18 as builder
FROM golang:1.22 as builder

ARG TARGETOS
ARG TARGETARCH
Expand Down
3 changes: 2 additions & 1 deletion devspace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ dev:
- '!/go.mod'
- '!/go.sum'
- '!/devspace_start.sh'
- 'Makefile'
- '!/Makefile'
- '!/Dockerfile'

commands:
dev: |-
Expand Down

0 comments on commit 61435d1

Please sign in to comment.