Skip to content

Commit 0542f3f

Browse files
committed
Added test and build jobs
Signed-off-by: Shovnik Bhattacharya <[email protected]>
1 parent 94ea14f commit 0542f3f

File tree

1 file changed

+86
-0
lines changed

1 file changed

+86
-0
lines changed

.github/workflows/test-build-deploy.yml

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,89 @@ jobs:
2929
run: make BUILD_IN_CONTAINER=false check-doc
3030
- name: Check White Noise.
3131
run: make BUILD_IN_CONTAINER=false check-white-noise
32+
33+
test:
34+
runs-on: ubuntu-latest
35+
container:
36+
image: quay.io/cortexproject/build-image:update-golang-1.14.9-eb0c8d4d2
37+
services:
38+
cassandra:
39+
image: cassandra:3.11
40+
env:
41+
JVM_OPTS: "-Xms1024M -Xmx1024M"
42+
ports:
43+
- 9042:9042
44+
steps:
45+
- name: Checkout Repo
46+
uses: actions/checkout@v1
47+
- name: Get Dependencies
48+
run: go get -v -t -d ./...
49+
- name: Sym Link Expected Path to Workspace
50+
run: |
51+
mkdir -p /go/src/github.com/cortexproject/cortex
52+
ln -s $GITHUB_WORKSPACE/* /go/src/github.com/cortexproject/cortex
53+
- name: Run Tests
54+
run: CASSANDRA_TEST_ADDRESSES=cassandra:9042 make BUILD_IN_CONTAINER=false test
55+
56+
build:
57+
runs-on: ubuntu-latest
58+
container:
59+
image: quay.io/cortexproject/build-image:update-golang-1.14.9-eb0c8d4d2
60+
steps:
61+
- name: Checkout Repo
62+
uses: actions/checkout@v1
63+
- name: Install Docker Client
64+
run: |
65+
set -x
66+
VER="17.03.0-ce"
67+
curl -L -o /tmp/docker-$VER.tgz https://download.docker.com/linux/static/stable/x86_64/docker-$VER.tgz
68+
tar -xz -C /tmp -f /tmp/docker-$VER.tgz
69+
mv /tmp/docker/* /usr/bin
70+
- name: Sym Link Expected Path to Workspace
71+
run: |
72+
mkdir -p /go/src/github.com/cortexproject/cortex
73+
ln -s $GITHUB_WORKSPACE/* /go/src/github.com/cortexproject/cortex
74+
- name: Build Image
75+
run: |
76+
touch build-image/.uptodate
77+
make BUILD_IN_CONTAINER=false
78+
- name: Build Website
79+
run: |
80+
touch build-image/.uptodate
81+
make BUILD_IN_CONTAINER=false web-build
82+
- uses: actions/upload-artifact@v2
83+
with:
84+
name: website public
85+
path: website/public/
86+
- uses: actions/upload-artifact@v2
87+
with:
88+
name: Frontend Protobuf
89+
path: pkg/querier/frontend/frontend.pb.go
90+
- uses: actions/upload-artifact@v2
91+
with:
92+
name: Caching Index Client Protobuf
93+
path: pkg/chunk/storage/caching_index_client.pb.go
94+
- uses: actions/upload-artifact@v2
95+
with:
96+
name: Ring Protobuf
97+
path: pkg/ring/ring.pb.go
98+
- uses: actions/upload-artifact@v2
99+
with:
100+
name: Cortex Protobuf
101+
path: pkg/ingester/client/cortex.pb.go
102+
- uses: actions/upload-artifact@v2
103+
with:
104+
name: Rules Protobuf
105+
path: pkg/ruler/rules/rules.pb.go
106+
- name: Save Images
107+
run: |
108+
mkdir /tmp/images
109+
ln -s /tmp/images ./docker-images
110+
make BUILD_IN_CONTAINER=false save-images
111+
- name: Zip Images
112+
run: tar -zcvf images.tar.gz /tmp/images
113+
- name: Upload Images Artifact
114+
uses: actions/upload-artifact@v2
115+
with:
116+
name: Docker Images
117+
path: ./images.tar.gz

0 commit comments

Comments
 (0)