Skip to content

Commit f2c0b41

Browse files
update workflow
1 parent 5d3d370 commit f2c0b41

1 file changed

Lines changed: 32 additions & 2 deletions

File tree

.github/workflows/compare-src.yml

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,34 @@ on:
2020
inputs: {}
2121

2222
jobs:
23+
check-gplv3-compliance:
24+
runs-on: ubuntu-latest
25+
steps:
26+
- name: Clone target repository
27+
run: |
28+
git clone --depth 1 --branch "${{ github.event.inputs.target_repo_branch }}" "${{ github.event.inputs.target_repo_url }}" targetrepo
29+
- name: Check for LICENSE file in target repository
30+
run: |
31+
if [ ! -f targetrepo/LICENSE ]; then
32+
echo "ERROR: LICENSE file not found in target repository." && exit 2
33+
fi
34+
- name: Check for GPLv3 in LICENSE file
35+
run: |
36+
if ! grep -q "GNU General Public License" targetrepo/LICENSE || ! grep -q "Version 3" targetrepo/LICENSE; then
37+
echo "ERROR: LICENSE file does not contain GPLv3 text." && exit 3
38+
fi
39+
- name: Check GPLv3 header in all .kt and .java files
40+
run: |
41+
missing_files=$(find targetrepo/app/src -type f \( -name '*.kt' -o -name '*.java' \) \
42+
! -exec grep -q 'GNU General Public License' {} \; -print)
43+
if [ -n "$missing_files" ]; then
44+
echo "ERROR: The following files are missing the GPLv3 header:" && echo "$missing_files"
45+
exit 4
46+
fi
47+
2348
compare-src:
2449
runs-on: ubuntu-latest
50+
needs: check-gplv3-compliance
2551
steps:
2652
- name: Checkout WiFiAnalyzer
2753
uses: actions/checkout@v4
@@ -68,10 +94,14 @@ jobs:
6894
with:
6995
distribution: 'temurin'
7096
java-version: '17'
71-
- name: Build target repository (Gradle)
97+
- name: Build target repository (assembleDebug)
98+
run: |
99+
cd targetrepo
100+
./gradlew assembleDebug
101+
- name: Build target repository (assembleRelease)
72102
run: |
73103
cd targetrepo
74-
./gradlew assembleDebug || ./gradlew build
104+
./gradlew assembleRelease
75105
- name: Upload APKs if present
76106
uses: actions/upload-artifact@v4
77107
with:

0 commit comments

Comments
 (0)