-
Notifications
You must be signed in to change notification settings - Fork 1
62 lines (55 loc) · 1.81 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
on: [push]
name: CI
jobs:
test:
name: "test"
env:
GOPATH: ${{ github.workspace }}
defaults:
run:
working-directory: ${{ env.GOPATH }}/src/github.com/${{ github.repository }}
strategy:
matrix:
go-version: [1.21.x]
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
- name: Checkout code
uses: actions/checkout@v2
with:
path: ${{ env.GOPATH }}/src/github.com/${{ github.repository }}
- name: Execute tests
run: |
go mod download
go mod verify
make test
k8s:
name: "k8s"
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
path: ${{ github.workspace }}/${{ github.repository }}
- name: Start minikube
id: minikube
uses: medyagh/setup-minikube@latest
- name: Build image
run: |
eval $(minikube -p minikube docker-env) && \
make docker-build CI=false && \
echo "docker_image=$(docker images --format '{{.Repository}}:{{.Tag}}' | head -n 1)" >> "$GITHUB_ENV"
working-directory: ${{ github.workspace }}/${{ github.repository }}
- name: Create pod
run: |
echo "Running ${{ env.docker_image }}" && \
kubectl run calls-offloader --image="${{ env.docker_image }}" \
--env="LOGGER_CONSOLELEVEL=debug" --env="LOGGER_ENABLEFILE=false" --env="JOBS_APITYPE=kubernetes"
working-directory: ${{ github.workspace }}/${{ github.repository }}
- name: Show logs
run: sleep 4s && kubectl logs calls-offloader
- name: Check pod is running
run: test $(kubectl get pods calls-offloader -o jsonpath='{.status.phase}') = "Running"