-
Notifications
You must be signed in to change notification settings - Fork 63
134 lines (112 loc) · 3.46 KB
/
async-icq.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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
name: async-icq
on:
pull_request:
paths:
- 'modules/async-icq/**'
- '.github/workflows/async-icq.yml'
env:
LINT_VERSION: v1.52
GO_VERSION: 1.21.0
WORKING_DIRECTORY: modules/async-icq
HOST_TAR_PATH: /tmp/icq-host.tar
HOST_IMAGE_NAME: icq-host
HOST_DOCKER_TAG: icq-host:local
CONTROLLER_TAR_PATH: /tmp/icq-demo.tar
CONTROLLER_IMAGE_NAME: icq-demo
CONTROLLER_DOCKER_TAG: icq-demo:local
jobs:
golangci:
name: Linter
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: golangci-lint
uses: golangci/golangci-lint-action@v2
with:
version: ${{ env.LINT_VERSION }}
working-directory: ${{ env.WORKING_DIRECTORY }}
args: --timeout=5m
test:
runs-on: ubuntu-latest
name: test
steps:
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}
- uses: actions/checkout@v4
- name: Test
run: go test ./...
working-directory: ${{ env.WORKING_DIRECTORY }}
build-docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Go ${{ env.GO_VERSION }}
uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and export Host
uses: docker/build-push-action@v5
with:
context: ${{ env.WORKING_DIRECTORY }}
tags: ${{ env.HOST_DOCKER_TAG }}
file: ${{ env.WORKING_DIRECTORY }}/Dockerfile.icq
outputs: type=docker,dest=${{ env.HOST_TAR_PATH }}
- name: Build and export Controller
uses: docker/build-push-action@v5
with:
context: ${{ env.WORKING_DIRECTORY }}
tags: ${{ env.CONTROLLER_DOCKER_TAG }}
file: ${{ env.WORKING_DIRECTORY }}/Dockerfile.icq-demo
outputs: type=docker,dest=${{ env.CONTROLLER_TAR_PATH }}
- name: Upload host artifact
uses: actions/upload-artifact@v3
with:
name: ${{ env.HOST_IMAGE_NAME }}
path: ${{ env.HOST_TAR_PATH }}
- name: Upload controller artifact
uses: actions/upload-artifact@v3
with:
name: ${{ env.CONTROLLER_IMAGE_NAME }}
path: ${{ env.CONTROLLER_TAR_PATH }}
e2e-tests:
needs: build-docker
runs-on: ubuntu-latest
defaults:
run:
working-directory: ${{ env.WORKING_DIRECTORY }}
strategy:
matrix:
test:
- "ictest-icq"
- "ictest-upgrade"
fail-fast: false
steps:
- name: Set up Go ${{ env.GO_VERSION }}
uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}
- name: checkout chain
uses: actions/checkout@v4
- name: Download Host Artifact
uses: actions/download-artifact@v3
with:
name: ${{ env.HOST_IMAGE_NAME }}
path: /tmp
- name: Download Controller Artifact
uses: actions/download-artifact@v3
with:
name: ${{ env.CONTROLLER_IMAGE_NAME }}
path: /tmp
- name: Load Docker Image
run: |
docker image load -i ${{ env.HOST_TAR_PATH }}
docker image load -i ${{ env.CONTROLLER_TAR_PATH }}
docker image load -i testing/previous_images/icq-host_7_0_0.tar
docker image ls -a
- name: Run Test
run: make ${{ matrix.test }}