forked from apache/eventmesh
-
Notifications
You must be signed in to change notification settings - Fork 0
109 lines (88 loc) · 3.34 KB
/
ci.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
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you 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: "Continuous Integration"
on:
push:
branches:
- develop
- '[0-9]+.[0-9]+.[0-9]+**'
pull_request:
branches:
- develop
- '[0-9]+.[0-9]+.[0-9]+**'
workflow_dispatch:
jobs:
build:
name: Build
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
language:
- 'java'
java:
- 8
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main
languages: ${{ matrix.language }}
- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v1
with:
java-version: ${{ matrix.java }}
- name: Build
# skip check here, since we use Checkstyle task to check the added file
run: ./gradlew clean build jacocoTestReport checkLicense -x check
- name: Perform CodeQL analysis
uses: github/codeql-action/analyze@v1
- name: Upload coverage report to codecov.io
run: bash <(curl -s https://codecov.io/bash) || echo 'Failed to upload coverage report!'
checkstyle:
name: Checkstyle
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Download checkstyle exectable
run: wget -O - -q https://github.com/checkstyle/checkstyle/releases/download/checkstyle-8.44/checkstyle-8.44-all.jar > ./checkstyle.jar
- name: Download reviewdog exectable
run: wget -O - -q https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh | sh -s -- -b . v0.12.0
- name: Check code style
env:
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
java -jar ./checkstyle.jar -c ./style/checkStyle.xml -f xml ./eventmesh-* \
| ./reviewdog -f=checkstyle -reporter=github-pr-check -filter-mode=added -fail-on-error
license-check:
name: License Check
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Check license header
uses: apache/skywalking-eyes@9bd5feb86b5817aa6072b008f9866a2c3bbc8587
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}