blob: 8fec237c792f22c49ef96a2027aca313a187164b [file]
name: CI
on:
push:
branches:
- main
- 'release-*'
- 'feature-*'
pull_request:
branches: "*"
permissions:
contents: read
concurrency:
group: ci-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
defaults:
run:
shell: bash
jobs:
license:
name: Check License Header
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v7
- name: Check License Header
uses: apache/skywalking-eyes/header@main #NOSONAR
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
config: .licenserc.yaml
mode: check
unit-test:
name: Unit Test
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Setup Go
uses: ./.github/actions/setup-go
- name: Run unit tests
run: make test
- name: Race Test
run: make test-race
- name: Codecov
uses: codecov/codecov-action@v7 #NOSONAR
with:
files: coverage.txt
fail_ci_if_error: true # optional (default = false)
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true # optional (default = false)
Integration-Test:
name: Integration Test
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Setup Go
uses: ./.github/actions/setup-go
- name: Run integration tests
env:
INTEGRATION_REPO: ${{ github.event.pull_request.head.repo.full_name || github.repository }}
INTEGRATION_SHA: ${{ github.event.pull_request.head.sha || github.sha }}
INTEGRATION_BRANCH: ${{ github.event_name == 'pull_request' && 'main' || github.ref_name }}
run: ./integrate_test.sh "$INTEGRATION_REPO" "$INTEGRATION_SHA" "$INTEGRATION_BRANCH"