Repository navigation
131 lines (122 loc) · 3.94 KB
/
Copy pathmain.yml
File metadata and controls
131 lines (122 loc) · 3.94 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
---
name: CrateDB SQL
on:
pull_request:
push:
branches:
- master
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
pull-requests: read
checks: write
statuses: write
jobs:
# Detect whether this PR touches any code. The real jobs below always run so
# that they always report a check run under a stable name (Mergify and branch
# protection treat a *skipped* job as missing, not as success).
changes:
name: Detect code changes
runs-on: ubuntu-latest
outputs:
java: ${{ github.event_name != 'pull_request' || steps.filter.outputs.java == 'true' }}
steps:
- uses: dorny/paths-filter@ceb8a2b8f2d89434be7ff52d3de7ec3738c5cc9d # 4.0.3
id: filter
if: github.event_name == 'pull_request'
with:
filters: |
java:
- '**.java'
- 'pom.xml'
- '**/pom.xml'
test:
name: Test CrateDB SQL on ${{ matrix.os }}
needs: changes
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v7
if: needs.changes.outputs.java == 'true'
with:
persist-credentials: false
- name: Setup Maven Java
if: needs.changes.outputs.java == 'true'
uses: actions/setup-java@b843ebf9b913146b38da2eaa7aeddf76074ae1ad # v6.1.0
with:
java-version: "27"
distribution: "temurin"
cache: maven
- name: Run tests on ${{ matrix.os }}
if: needs.changes.outputs.java == 'true'
env:
CRATE_TESTS_SQL_REQUEST_TIMEOUT: "20"
run: |
./mvnw test \
-Dtoolchain.skip=true \
-Dtests.crate.run-windows-incompatible=true \
-DforkCount=2 \
-DthreadCount=2 \
-Dcheckstyle.skip \
-Dforbiddenapis.skip=true \
-Dmaven.javadoc.skip=true \
-Djacoco.skip=true
- name: Publish Test Report
if: needs.changes.outputs.java == 'true' && (success() || failure())
uses: ScalableCapital/action-surefire-report@1e92f48016e566e4eed2d81560edbfe0f524cfb7 #v2.0.3
with:
# GITHUB_TOKEN is read-only for PRs from forks, so the step fails with 403
skip_publishing: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository }}
forbiddenApis:
name: forbiddenApis
needs: changes
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
if: needs.changes.outputs.java == 'true'
with:
persist-credentials: false
- name: Setup Maven Java
if: needs.changes.outputs.java == 'true'
uses: actions/setup-java@b843ebf9b913146b38da2eaa7aeddf76074ae1ad # v6.1.0
with:
java-version: "27"
distribution: "temurin"
cache: maven
- name: Run forbiddenapis:check
if: needs.changes.outputs.java == 'true'
run: |
./mvnw \
-Dtoolchain.skip=true \
-Dmaven.javadoc.skip=true \
-Djacoco.skip=true \
-Dcheckstyle.skip \
compile forbiddenapis:check
checkstyle:
name: checkstyle
needs: changes
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
if: needs.changes.outputs.java == 'true'
with:
persist-credentials: false
- name: Setup Maven Java
if: needs.changes.outputs.java == 'true'
uses: actions/setup-java@b843ebf9b913146b38da2eaa7aeddf76074ae1ad # v6.1.0
with:
java-version: "27"
distribution: "temurin"
- name: Run checkstyle
if: needs.changes.outputs.java == 'true'
run: |
./mvnw \
-Dtoolchain.skip=true \
-Dmaven.javadoc.skip=true \
-Djacoco.skip=true \
-Dforbiddenapis.skip=true \
compile checkstyle:checkstyle