-
Notifications
You must be signed in to change notification settings - Fork 62
111 lines (92 loc) · 2.81 KB
/
gh-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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
name: test-gh
on:
push:
branches:
- develop
pull_request:
types: [opened, reopened, synchronize]
jobs:
test-all:
name: Test GH - Linux
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v3
with:
go-version: "1.21.1"
- name: Check out code into the Go module directory
uses: actions/checkout@v2
with:
path: src/github.com/${{ github.repository }}
- name: Run Tests
run: |
set -e -x
export GOPATH=$(echo `pwd`)
export PATH="$PATH:$GOPATH/bin"
cd src/github.com/${{ github.repository }}
# deploy local registry and run tests
./hack/test-all-local-registry.sh
test-all-windows:
name: Test GH - Windows
runs-on: windows-latest
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v3
with:
go-version: "1.21.1"
- name: Check out code into the Go module directory
uses: actions/checkout@v2
with:
path: src/github.com/${{ github.repository }}
- name: Install dependencies
run: |
bash -c '
set -e -x
export GOPATH=$(echo `pwd`)
export PATH="$GOPATH/bin:$PATH"
go install github.com/sigstore/cosign/cmd/[email protected]
alias cosign=cosign.exe
'
- name: Compile imgpkg
run: |
bash -c '
set -e -x
export GOPATH=$(echo `pwd`)
export PATH="$GOPATH/bin:$PATH"
cd src/github.com/${{ github.repository }}
export IMGPKG_BINARY_EXT=".exe"
./hack/build.sh
'
- name: Run Tests e2e tests
run: |
bash -c '
set -e -x
function cleanup()
{
docker stop registry
}
export GOPATH=$(echo `pwd`)
export PATH="$GOPATH/bin:$PATH"
cd src/github.com/${{ github.repository }}
export IMGPKG_E2E_IMAGE="localhost:5000/github-action-test-relocation-$GITHUB_RUN_ID"
export IMGPKG_E2E_RELOCATION_REPO="localhost:5000/github-action-imgpkg-test-$GITHUB_RUN_ID"
docker run -d -p 5000:5000 --restart=always --name registry ghcr.io/carvel-dev/imgpkg/registry-windows:2.8.0-2022
trap cleanup EXIT
export IMGPKG_BINARY="$PWD/imgpkg.exe"
./hack/test.sh
./hack/test-e2e.sh
echo ALL SUCCESS
'
- name: Run Tests performance
run: |
bash -c '
set -e -x
export GOPATH=$(echo `pwd`)
export PATH="$GOPATH/bin:$PATH"
cd src/github.com/${{ github.repository }}
export IMGPKG_E2E_IMAGE="ttl.sh/github-action-test-relocation-$GITHUB_RUN_ID"
export IMGPKG_E2E_RELOCATION_REPO="ttl.sh/github-action-imgpkg-test-$GITHUB_RUN_ID"
export IMGPKG_BINARY="$PWD/imgpkg.exe"
./hack/test-perf.sh
echo ALL SUCCESS
'