-
Notifications
You must be signed in to change notification settings - Fork 392
122 lines (107 loc) · 4.15 KB
/
maven-ci.yml
File metadata and controls
122 lines (107 loc) · 4.15 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
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
name: Java CI with Maven
on:
push:
pull_request:
jobs:
license:
name: "Check License"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: "Check License"
uses: apache/skywalking-eyes@e1a02359b239bd28de3f6d35fdc870250fa513d5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: "Check Dependencies' License"
uses: apache/skywalking-eyes/dependency@e1a02359b239bd28de3f6d35fdc870250fa513d5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
config: .licenserc.yaml
mode: check
module-sync:
name: "Check Module Sync"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check extension modules are synced to agentscope-all and agentscope-bom
run: |
chmod +x .github/scripts/check-shade-and-bom-sync.sh
./.github/scripts/check-shade-and-bom-sync.sh
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: [ ubuntu-latest, windows-latest ]
include:
- os: ubuntu-latest
repo-cache-path: '~/.m2/repository'
mvnd-cache-path: '~/.mvnd'
- os: windows-latest
repo-cache-path: '~\.m2\repository'
mvnd-cache-path: '~\.mvnd'
env:
MVND_VERSION: '1.0.3'
JAVA_VERSION: '17'
steps:
- uses: actions/checkout@v4
- name: Set up JDK ${{ env.JAVA_VERSION }}
uses: actions/setup-java@v4
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: 'temurin'
cache: 'maven'
- name: Cache Maven repository [${{ runner.os }}]
uses: actions/cache@v4
with:
path: ${{ matrix.repo-cache-path }}
key: maven-${{ runner.os }}-${{ hashFiles('**/pom.xml') }}
restore-keys: |
maven-${{ runner.os }}-
- name: Cache mvnd [${{ runner.os }}]
id: cache-mvnd
uses: actions/cache@v4
with:
path: ${{ matrix.mvnd-cache-path }}
key: mvnd-${{ env.MVND_VERSION }}-${{ runner.os }}
- name: Install mvnd [Linux]
if: steps.cache-mvnd.outputs.cache-hit != 'true' && runner.os == 'Linux'
shell: bash
run: |
curl -fsSL https://github.com/apache/maven-mvnd/releases/download/${{ env.MVND_VERSION }}/maven-mvnd-${{ env.MVND_VERSION }}-linux-amd64.tar.gz | tar xz
mkdir -p ~/.mvnd
mv maven-mvnd-${{ env.MVND_VERSION }}-linux-amd64/* ~/.mvnd/
- name: Install mvnd [Windows]
if: steps.cache-mvnd.outputs.cache-hit != 'true' && runner.os == 'Windows'
shell: pwsh
run: |
Invoke-WebRequest `
-Uri "https://github.com/apache/maven-mvnd/releases/download/${{ env.MVND_VERSION }}/maven-mvnd-${{ env.MVND_VERSION }}-windows-amd64.zip" `
-OutFile "mvnd.zip"
mkdir -Path "~\.mvnd" -Force
Expand-Archive -Path "mvnd.zip" -DestinationPath "mvnd" -FORCE
Copy-Item -Path "mvnd\maven-mvnd-${{ env.MVND_VERSION }}-windows-amd64\*" -Destination "~\.mvnd\" -Recurse
Remove-Item -Path "mvnd", "mvnd.zip" -Recurse -Force
- name: Build and Test with Coverage [Linux]
if: runner.os == 'Linux'
run: |
export PATH="$HOME/.mvnd/bin:$PATH"
mvnd -B clean verify
- name: Build and Test with Coverage [Windows]
if: runner.os == 'Windows'
run: |
& "~\.mvnd\bin\mvnd.cmd" -B clean verify
- name: Upload coverage reports to Codecov
if: runner.os == 'Linux'
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
verbose: true