Skip to content

Commit 84fb5b3

Browse files
committed
ci: add workflow
1 parent 50e5bf1 commit 84fb5b3

File tree

1 file changed

+72
-0
lines changed

1 file changed

+72
-0
lines changed

.github/workflows/push_ci.yml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: main
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches: [ main ]
7+
paths-ignore:
8+
- '**.md'
9+
- '**.txt'
10+
- 'renovate.json'
11+
- '.editorconfig'
12+
- '.gitignore'
13+
- '.github/**'
14+
- '.idea/**'
15+
- '!.github/workflows/**'
16+
17+
jobs:
18+
build:
19+
name: Build CI (Push)
20+
runs-on: ubuntu-24.04
21+
env:
22+
CCACHE_COMPILERCHECK: "%compiler% -dumpmachine; %compiler% -dumpversion"
23+
CCACHE_NOHASHDIR: "true"
24+
CCACHE_HARDLINK: "true"
25+
CCACHE_BASEDIR: "${{ github.workspace }}"
26+
if: ${{ github.ref == 'refs/heads/main' }}
27+
28+
steps:
29+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
30+
with:
31+
submodules: 'true'
32+
fetch-depth: 0
33+
34+
- name: Config submodules
35+
run: |
36+
git submodule foreach git submodule update --init --recursive
37+
38+
- name: set up JDK 17
39+
uses: actions/[email protected]
40+
with:
41+
java-version: '17'
42+
distribution: 'adopt'
43+
44+
- name: Build Native Libs
45+
run: |
46+
mkdir -p native/build && cmake -S native -B native/build && make -C native/build jvmplant -j 4
47+
echo "NATIVE_LIB_BUILD_DIR=$(realpath native/build)" >> $GITHUB_ENV
48+
49+
- name: Setup Gradle
50+
uses: gradle/[email protected]
51+
52+
- name: Build with Gradle
53+
run: |
54+
echo 'org.gradle.parallel=true' >> gradle.properties
55+
echo 'org.gradle.vfs.watch=true' >> gradle.properties
56+
sed -i 's/org.gradle.configuration-cache=true//g' gradle.properties
57+
echo 'buildCache { local { removeUnusedEntriesAfterDays = 1 } }' >> settings.gradle.kts
58+
./gradlew :jvm:core:assemble :jvm:xposed:assemble
59+
60+
- name: Run tests
61+
run: |
62+
./gradlew :jvm:test:test --tests "dev.tmpfs.jvmplant.test.HookTests"
63+
env:
64+
JVMPLANT_TEST_NATIVE_DIR: ${{ env.NATIVE_LIB_BUILD_DIR }}
65+
66+
- name: Upload Artifacts
67+
uses: actions/upload-artifact@v4
68+
with:
69+
path: |
70+
jvm/**/build/libs/*.jar
71+
native/build/*.(so|dylib|dll|a)
72+
name: JvmXposed-linux-x86_64-${{ github.event.head_commit.id }}

0 commit comments

Comments
 (0)