-
Notifications
You must be signed in to change notification settings - Fork 18
83 lines (69 loc) · 2.13 KB
/
build-and-run-tests.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
name: Build and Run Tests [gradle]
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
workflow_dispatch:
jobs:
build:
strategy:
matrix:
java: [ '11' ]
runs-on: ubuntu-20.04
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: "true"
- name: Setup Java JDK
uses: actions/[email protected]
with:
distribution: "zulu"
java-version: ${{ matrix.java }}
cache: "gradle"
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: '22'
- name: Set up ArkAnalyzer
run: |
REPO_URL="https://gitee.com/Lipenx/arkanalyzer.git"
DEST_DIR="arkanalyzer"
MAX_RETRIES=10
RETRY_DELAY=3 # Delay between retries in seconds
BRANCH="neo/2024-08-07"
for ((i=1; i<=MAX_RETRIES; i++)); do
git clone --depth=1 --branch $BRANCH $REPO_URL $DEST_DIR && break
echo "Clone failed, retrying in $RETRY_DELAY seconds..."
sleep "$RETRY_DELAY"
done
if [[ $i -gt $MAX_RETRIES ]]; then
echo "Failed to clone the repository after $MAX_RETRIES attempts."
exit 1
else
echo "Repository cloned successfully."
fi
echo "ARKANALYZER_DIR=$(realpath $DEST_DIR)" >> $GITHUB_ENV
cd $DEST_DIR
npm install
npm run build
- name: Install CPython optional dependencies
run: |
sudo apt-get update
sudo apt-get install -yq\
libssl-dev \
libffi-dev
- name: Build and run tests
run: |
./gradlew build --no-daemon -PcpythonActivated=true --scan
- name: Run Detekt
run: |
./gradlew detektMain detektTest --no-daemon
- name: Upload SARIF to GitHub
uses: github/codeql-action/upload-sarif@v3
if: success() || failure()
with:
sarif_file: build/reports/detekt/detekt.sarif