-
Notifications
You must be signed in to change notification settings - Fork 3
100 lines (95 loc) · 3.07 KB
/
CI.yaml
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
# Copyright 2023 SkyAPM org
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
name: CI
# This process will only run upon scheduled event on upstream master
# or upon pull request when actual code or CI flow is changed
on:
pull_request:
push:
branches:
- main
schedule:
- cron: '0 18 * * *'
concurrency:
group: CI-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
license-and-lint:
# Always check license-and-lint!
name: License and Lint
runs-on: ubuntu-latest
steps:
- name: Checkout source codes
uses: actions/checkout@v3
with:
submodules: true
- name: Check License
uses: apache/skywalking-eyes/header@501a28d2fb4a9b962661987e50cf0219631b32ff
- name: Lint codes
run: |
make poetry
poetry install --only lint
make lint
docker:
name: Build Docker Image
runs-on: ubuntu-latest
steps:
- name: Checkout source codes
uses: actions/checkout@v3
with:
submodules: true
- name: Build and Save Docker image
run: |
docker build -t r3:latest .
docker save -o r3-image.tar r3:latest
- name: Upload docker images
uses: actions/upload-artifact@v3
with:
name: docker-image
path: r3-image.tar
e2e:
name: E2E test
runs-on: ubuntu-latest
needs: [ docker ]
timeout-minutes: 60
steps:
- uses: actions/checkout@v3
with:
submodules: true
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install docker-compose
shell: bash
run: |
if ! command docker-compose 2>&1 > /dev/null; then
echo "Installing docker-compose"
sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
fi
- uses: actions/download-artifact@v3
name: Download docker images
with:
name: docker-image
path: docker-image
- name: Load docker images
run: |
find docker-image -name "*.tar" -exec docker load -i {} \;
find docker-image -name "*.tar" -exec rm {} \;
- name: Setup Python Path
run: echo "PYTHONPATH=$(pwd)" >> $GITHUB_ENV
- name: Run E2E test
uses: apache/skywalking-infra-e2e@cf589b4a0b9f8e6f436f78e9cfd94a1ee5494180
with:
e2e-file: $GITHUB_WORKSPACE/test/e2e/e2e.yaml