-
Notifications
You must be signed in to change notification settings - Fork 5
115 lines (104 loc) · 4.13 KB
/
Copy pathpr.yml
File metadata and controls
115 lines (104 loc) · 4.13 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
name: PR CI Checks
on: [pull_request]
jobs:
check-commit-message:
name: Check Commit Message
runs-on: ubuntu-latest
steps:
- name: Check JIRA ID
uses: gsactions/commit-message-checker@v1
with:
pattern: '(\[?[A-Z]{1,5}-[1-9][0-9]*)|(\[AUTOMATED\])|(Merge)|(Release).+$'
flags: "gm"
excludeDescription: "true"
checkAllCommitMessages: "true"
accessToken: ${{ secrets.PAT_ACTIONS }}
error: "One of your your commit messages is not matching the format with JIRA ID Ex: ( SDK-123 commit message )"
Test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-java@v1
with:
java-version: "11"
- name: create-json
id: create-json
uses: jsdaniell/create-json@1.1.2
with:
name: "credentials.json"
json: ${{ secrets.TEST_CREDENTIALS_FILE_STRING }}
- name: create env
id: create-env
run: |
touch .env
echo SKYFLOW_CREDENTIALS=${{ secrets.SKYFLOW_CREDENTIALS }} >> .env
echo TEST_EXPIRED_TOKEN=${{ secrets.TEST_EXPIRED_TOKEN }} >> .env
echo TEST_REUSABLE_TOKEN=${{ secrets.TEST_REUSABLE_TOKEN }} >> .env
- name: Distribute test fixtures to modules
run: |
# Surefire runs each module's tests with the module directory as the working
# directory, so dotenv and ./credentials.json lookups miss the repo-root copies.
for module in common skyvault flowvault; do
cp .env "$module/.env"
cp credentials.json "$module/credentials.json"
done
- name: Build & Run tests with Maven
run: mvn -B package -f pom.xml -Dmaven.javadoc.skip=true
# JaCoCo records packages as "com/skyflow/..." with no module prefix, and all three
# modules share the com.skyflow package (deliberate split-package convention). So
# "com/skyflow/config/VaultConfig.java" matches BOTH skyvault and flowvault, Codecov
# resolves it to one of them, and the other module's file silently reports no data.
# Prefixing each report with its own source root makes every path unique and match the
# repo exactly, so all three modules' files are attributed correctly.
- name: Qualify JaCoCo report paths with their module
run: |
for module in common skyvault flowvault; do
report="$module/target/site/jacoco/jacoco.xml"
if [ ! -f "$report" ]; then
echo "Error: expected $report to exist after the build."
exit 1
fi
tmp="$(mktemp)"
sed "s|<package name=\"|<package name=\"$module/src/main/java/|g" "$report" > "$tmp"
mv "$tmp" "$report"
done
# One upload per module, each with its own flag, so Codecov reports per-module
# coverage instead of merging three same-named package trees into one number.
- name: Codecov (common)
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_REPO_UPLOAD_TOKEN }}
files: common/target/site/jacoco/jacoco.xml
flags: common
name: codecov-common
verbose: true
fail_ci_if_error: true
- name: Codecov (skyvault)
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_REPO_UPLOAD_TOKEN }}
files: skyvault/target/site/jacoco/jacoco.xml
flags: skyvault
name: codecov-skyvault
verbose: true
fail_ci_if_error: true
- name: Codecov (flowvault)
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_REPO_UPLOAD_TOKEN }}
files: flowvault/target/site/jacoco/jacoco.xml
flags: flowvault
name: codecov-flowvault
verbose: true
fail_ci_if_error: true
spellcheck:
name: Run spellcheck
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: streetsidesoftware/cspell-action@v8
with:
config: .cspell.json
strict: true
inline: error
incremental_files_only: false