Repository navigation
90 lines (81 loc) · 3.47 KB
/
Copy patherrorprone.yml
File metadata and controls
90 lines (81 loc) · 3.47 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
name: Error Prone checks
# Runs the framework's custom Error Prone BugCheckers (currently just
# BanClassForName) over CodenameOne/src and over the backend runtime
# (vm/backend), which ParparVM translates the same way. The check fails the build when
# someone adds a Class.forName(...) call, which silently breaks on
# ParparVM (iOS) because the iOS port cannot resolve classes by string
# name at runtime.
permissions:
contents: read
on:
workflow_dispatch:
pull_request:
branches:
- master
paths:
- 'scripts/ci/retry.sh'
- 'CodenameOne/src/**/*.java'
- 'maven/errorprone-checks/**'
- 'maven/core/pom.xml'
- 'vm/backend/src/**/*.java'
- 'vm/backend/impl/javase/**/*.java'
- 'vm/backend/impl/parparvm/**/*.java'
- 'maven/backend-parparvm/pom.xml'
- 'vm/backend/shared-sources.sh'
- 'maven/backend/pom.xml'
- 'maven/pom.xml'
- '.github/workflows/errorprone.yml'
push:
branches:
- master
paths:
- 'scripts/ci/retry.sh'
- 'CodenameOne/src/**/*.java'
- 'maven/errorprone-checks/**'
- 'maven/core/pom.xml'
- 'vm/backend/src/**/*.java'
- 'vm/backend/impl/javase/**/*.java'
- 'vm/backend/impl/parparvm/**/*.java'
- 'maven/backend-parparvm/pom.xml'
- 'vm/backend/shared-sources.sh'
- 'maven/backend/pom.xml'
- 'maven/pom.xml'
- '.github/workflows/errorprone.yml'
concurrency:
# Only the latest revision needs validation. PR numbers keep forks isolated;
# event names keep a manual/scheduled run from cancelling a push or PR run.
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
errorprone:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v6
- name: Set up JDK 17
uses: actions/setup-java@v5
with:
# Error Prone requires JDK 11+; we pick 17 to match the
# framework's Android-port JAVA17_HOME requirement.
distribution: temurin
java-version: 17
cache: maven
- name: Install errorprone-checks
working-directory: maven
# The checker module must be installed to the local repo BEFORE
# core compiles. We can't rely on the reactor ordering: core
# references errorprone-checks only via annotationProcessorPaths,
# which Maven does not treat as a build-time dependency, so the
# reactor would otherwise schedule core first and fail to resolve
# com.codenameone:errorprone-checks:8.0-SNAPSHOT.
# Retried: this step resolves plugins from Central cold, and Central has been
# answering 502/403 today. Maven treats that as permanent. See bash scripts/ci/retry.sh mvn.
run: bash ../scripts/ci/retry.sh mvn -B -Perrorprone -pl errorprone-checks -am install -DskipTests
- name: Run Error Prone over the core module
working-directory: maven
run: bash $GITHUB_WORKSPACE/scripts/ci/retry.sh mvn -B -Perrorprone -pl core -am install -DskipTests
# Both implementations: maven/backend compiles impl/javase, and
# backend-parparvm (activated by -DbackendAnalysis) compiles impl/parparvm,
# the one a server binary is actually built from.
- name: Run Error Prone over the backend runtime
working-directory: maven
run: bash $GITHUB_WORKSPACE/scripts/ci/retry.sh mvn -B -Perrorprone -DbackendAnalysis -pl backend,backend-parparvm -am install -DskipTests