-
Notifications
You must be signed in to change notification settings - Fork 0
97 lines (79 loc) · 3.05 KB
/
ci.yml
File metadata and controls
97 lines (79 loc) · 3.05 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
name: MARSLib FRC CI
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: write
pull-requests: write
pages: write
id-token: write
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Remove hardcoded local Java home
run: sed -i '/org.gradle.java.home/d' gradle.properties || true
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build and Test with Coverage
run: ./gradlew build jacocoTestReport -Pskip-inspector-wrapper -Dorg.gradle.java.home=$JAVA_HOME
- name: Upload Test Reports (on failure)
if: failure()
uses: actions/upload-artifact@v4
with:
name: MARSLib-Test-Reports
path: build/reports/tests/test/
- name: Upload Compiled JAR
uses: actions/upload-artifact@v4
with:
name: MARSLib-Build
path: build/libs/*.jar
- name: Run Performance Benchmarks
run: ./gradlew test --tests "*performance*" -Pskip-inspector-wrapper -Dorg.gradle.java.home=$JAVA_HOME
- name: Upload Performance Results
if: always()
uses: actions/upload-artifact@v4
with:
name: MARSLib-Performance-Results
path: build/test-results/test/
- name: Compare Performance Baselines
if: github.event_name == 'pull_request'
run: |
python3 scripts/compare_performance.py --baseline config/performance/baselines.json --results build/reports/performance/results.json --verbose || true
- name: Post PR Coverage Annotations
uses: madrapps/jacoco-report@v1.7.2
if: github.event_name == 'pull_request'
with:
paths: build/reports/jacoco/test/jacocoTestReport.xml
token: ${{ secrets.GITHUB_TOKEN }}
min-coverage-overall: 80
min-coverage-changed-files: 80
title: "Test Coverage Report"
- name: Generate Documentation Site and Publish Maven
if: github.ref == 'refs/heads/master' && github.event_name == 'push'
run: ./gradlew generateDocs publish -Pskip-inspector-wrapper -Dorg.gradle.java.home=$JAVA_HOME
- name: Deploy Java Artifacts to master branch
if: github.ref == 'refs/heads/master' && github.event_name == 'push'
run: |
# Wipe old Astro documentation files from Github Pages to clean repository
find docs -mindepth 1 -maxdepth 1 ! -name 'javadoc' ! -name 'maven' ! -name 'MARSLib.json' -exec rm -rf {} +
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add docs/ -A
git diff --cached --quiet && echo "No docs changes" || (git commit -m "docs: auto-deploy Java Artifacts [skip ci]" && git push)