Skip to content

CI

CI #339

Workflow file for this run

# 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