-
Notifications
You must be signed in to change notification settings - Fork 20
60 lines (50 loc) · 1.86 KB
/
functional-test.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
# This workflow will build a golang project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go
name: Functional-tests
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set Go
uses: actions/setup-go@v3
with:
go-version: v1.19
- name: init directories
run: mkdir -p "$(pwd)/bin"
- name: Download kubebuilder
run: |
version=1.0.8
arch=amd64
curl -L -O "https://github.com/kubernetes-sigs/kubebuilder/releases/download/v${version}/kubebuilder_${version}_linux_${arch}.tar.gz"
tar -zxvf kubebuilder_${version}_linux_${arch}.tar.gz
mv kubebuilder_${version}_linux_${arch} kubebuilder
echo "kubebuilder_${version}_linux_${arch} renamed to kubebuilder"
sudo mv kubebuilder /usr/local/
echo "kubebuilder moved to /usr/local/ path"
DIRECTORY=/usr/local/kubebuilder
if [ -d "$DIRECTORY" ]; then
echo "$DIRECTORY does exist."
else
echo "$DIRECTORY does not exist."
fi
echo "PATH=$PATH:$DIRECTORY/bin" >> $GITHUB_ENV
export PATH=$PATH:$DIRECTORY/bin
- name: Set up Kubebuilder and setup-envtest
run: |
make envtest
echo "Kubebuilder-envtest : $(./bin/setup-envtest use 1.23 -p path)"
echo "KUBEBUILDER_ASSETS=$(./bin/setup-envtest use 1.23 -p path)" >> $GITHUB_ENV
echo "USE_EXISTING_CLUSTER=false" >> $GITHUB_ENV
- name: Test
run: go test -v ./functional-tests
- name: Upload test log as artifact
uses: actions/upload-artifact@v2
with:
name: functional-test-logs
path: $HOME/instascale/instascale/functional-tests/functional-test-logfile.log