Repository navigation
74 lines (61 loc) · 1.78 KB
/
Copy pathtest.yml
File metadata and controls
74 lines (61 loc) · 1.78 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
name: Test
on:
push:
branches:
- master
pull_request:
branches:
- master
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
name: Run Unit Tests & Build Check
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./V2rayNG
steps:
- name: Checkout repository
uses: actions/checkout@v7
with:
submodules: 'recursive'
fetch-depth: '0'
- name: Set up JDK 21
uses: actions/setup-java@v6
with:
distribution: 'temurin'
java-version: '21'
- name: Fetch AndroidLibXrayLite tag
run: |
pushd ${{ github.workspace }}/AndroidLibXrayLite
CURRENT_TAG=$(git describe --tags --abbrev=0)
echo "Current tag in this repo: $CURRENT_TAG"
echo "CURRENT_TAG=$CURRENT_TAG" >> $GITHUB_ENV
popd
- name: Download libv2ray
uses: robinraju/release-downloader@v1.13
with:
repository: '2dust/AndroidLibXrayLite'
tag: ${{ env.CURRENT_TAG }}
fileName: 'libv2ray.aar'
out-file-path: V2rayNG/app/libs/
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v6
with:
build-root-directory: ./V2rayNG
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Run unit tests
run: ./gradlew test --stacktrace
- name: Build debug APKs
run: ./gradlew assemblePlaystoreDebug assembleFdroidDebug --stacktrace
- name: Upload test results
if: always()
uses: actions/upload-artifact@v7
with:
name: test-results
path: V2rayNG/app/build/reports/tests/
retention-days: 7