This repository has been archived by the owner on Jun 4, 2022. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 0
116 lines (103 loc) · 2.9 KB
/
java_ci.yml
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
name: Java CI
on:
push: {}
pull_request:
branches: [main]
jobs:
build:
name: Compile (Java ${{ matrix.jdk }})
runs-on: ubuntu-latest
timeout-minutes: 10
strategy:
matrix:
jdk: [8, 11, 17, 18]
fail-fast: false
steps:
- name: 📤 Checkout Repository
uses: actions/checkout@v3
- name: ☕ Install Java
uses: actions/setup-java@v3
with:
architecture: x64
distribution: temurin
java-version: ${{ matrix.jdk }}
cache: maven
- name: ✔ Compile with Maven
run: mvn compile -DskipTests --no-transfer-progress
codeql:
name: CodeQL (Java 17)
runs-on: ubuntu-latest
timeout-minutes: 10
needs: build
if: github.event_name == 'pull_request' || github.actor != 'dependabot[bot]'
steps:
- name: 📤 Checkout Repository
uses: actions/checkout@v3
- name: 📚 Install CodeQL
uses: github/codeql-action/init@v2
with:
languages: java
queries: security-and-quality
- name: ☕ Install Java
uses: actions/setup-java@v3
with:
architecture: x64
distribution: temurin
java-version: 17
cache: maven
- name: ✔ Compile with Maven
run: mvn compile -DskipTests --no-transfer-progress
- name: ✔ Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
test:
name: Test (Java ${{ matrix.jdk }})
runs-on: ubuntu-latest
timeout-minutes: 10
needs: codeql
strategy:
matrix:
jdk: [8, 11, 17, 18]
fail-fast: false
env:
# CoreTests.TestInput
INPUT_INPUT: 'val'
INPUT_SPECIAL_CHARS: "' \"\\ response "
INPUT_MULTIPLE_SPACE_VARIABLE: 'I have multiple spaces'
INPUT_MULTIPLE_LINES: |
val1
val2
val3
INPUT_WHITESPACE: ' some val '
INPUT_BOOLEAN: 'true'
INPUT_TRUE1: 'true'
INPUT_TRUE2: 'True'
INPUT_TRUE3: 'TRUE'
INPUT_FALSE1: 'false'
INPUT_FALSE2: 'False'
INPUT_FALSE3: 'FALSE'
INPUT_WRONG: 'wrong'
# CoreTests.TestState
STATE_TEST_1: 'state_val'
# fix for pull_request event on dependabot
RUNNER_DEBUG: '1'
steps:
- name: 📤 Checkout Repository
uses: actions/checkout@v3
- name: ☕ Install Java
uses: actions/setup-java@v3
with:
architecture: x64
distribution: temurin
java-version: ${{ matrix.jdk }}
cache: maven
- id: mvn
name: ✔ Test with Maven
run: mvn test -fae --no-transfer-progress
- name: ✔ Test Output
if: |
steps.mvn.outputs['some output'] != '1.01' &&
steps.mvn.outputs['some output'] != 'false' &&
steps.mvn.outputs['some output'] != 'some value'
run: |
echo "::set-failed::Output is missing"
exit 1