This repository was archived by the owner on Nov 16, 2021. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 0
139 lines (119 loc) · 4.93 KB
/
Copy pathci-build.yml
File metadata and controls
139 lines (119 loc) · 4.93 KB
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
135
136
137
138
139
# ----------------------------------------------------------------------------
# Copyright 2021 The Netty Project
#
# The Netty Project 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:
#
# https://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: Build
on:
push:
pull_request:
workflow_dispatch: # Allows you to run this workflow manually from the Actions tab
schedule:
- cron: '30 8 * * 1' # At 08:30 on Monday, every Monday.
env:
MAVEN_OPTS: -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.http.retryhandler.count=5 -Dmaven.wagon.httpconnectionManager.ttlSeconds=240
jobs:
Test:
runs-on: ubuntu-latest
steps:
- name: Check out project
uses: actions/checkout@v2
with:
path: project
- name: Check out Netty core snapshot
uses: actions/checkout@v2
with:
repository: netty/netty
path: netty
ref: ${{ github.ref }} # Netty core branch of same name as our contrib branch
fetch-depth: 1
# Configure Java
- uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: '11'
cache: 'maven'
- name: Build Netty Core
run: mvn install -B -T1C -q -am -pl :netty-transport,:netty-codec,:netty-handler,:netty-resolver-dns -DskipTests -Dcheckstyle.skip -Dxml.skip -Danimal.sniffer.skip -Djapicmp.skip -Drevapi.skip -Dmaven.javadoc.skip
working-directory: ./netty
# See https://docs.github.com/en/actions/learn-github-actions/workflow-commands-for-github-actions#setting-an-environment-variable
- name: Get Netty Core version
run: echo "netty_version=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_ENV
working-directory: ./netty
- name: Build Project
run: |
set -euo pipefail
mvn install -B -T1C -ntp -Pleak '-Dnetty.version=${{ env.netty_version }}' |& tee build-output.txt
working-directory: ./project
- name: Publish Test Reports
if: ${{ failure() }}
uses: scacap/action-surefire-report@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
report_paths: './project/**/target/surefire-reports/TEST-*.xml'
commit: ${{ github.event.workflow_run.head_commit.id }}
check_name: Test Reports
- name: Check for Leaks
if: ${{ always() }}
run: |
./project/.github/scripts/check_leak.sh ./project/build-output.txt
- name: Uploading Build Artifacts
uses: actions/upload-artifact@v2
if: ${{ failure() }}
with:
name: artifacts
path: |
./project/**/target/surefire-reports/
./project/build-output.txt
**/hs_err*.log
CodeQL:
runs-on: ubuntu-latest
permissions:
security-events: write
steps:
- name: Check out project
uses: actions/checkout@v2
with:
path: project
- name: Check out Netty core snapshot
uses: actions/checkout@v2
with:
repository: netty/netty
path: netty
ref: ${{ github.ref }} # Netty core branch of same name as our contrib branch
fetch-depth: 1
# Configure Java
- uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: '11'
cache: 'maven'
- name: Build Netty Core
run: mvn install -B -T1C -q -am -pl :netty-transport,:netty-codec,:netty-handler,:netty-resolver-dns -DskipTests -Dcheckstyle.skip -Dxml.skip -Danimal.sniffer.skip -Djapicmp.skip -Drevapi.skip -Dmaven.javadoc.skip
working-directory: ./netty
# See https://docs.github.com/en/actions/learn-github-actions/workflow-commands-for-github-actions#setting-an-environment-variable
- name: Get Netty Core version
run: echo "netty_version=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_ENV
working-directory: ./netty
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: java
- name: Build Project
run: mvn compile -B -T1C -ntp -Dnetty.version=${{ env.netty_version }}
working-directory: ./project
- name: Remove Netty Core from Analysis
run: rm -fr ./netty
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1