|
20 | 20 | inputs: {} |
21 | 21 |
|
22 | 22 | 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 | +
|
23 | 48 | compare-src: |
24 | 49 | runs-on: ubuntu-latest |
| 50 | + needs: check-gplv3-compliance |
25 | 51 | steps: |
26 | 52 | - name: Checkout WiFiAnalyzer |
27 | 53 | uses: actions/checkout@v4 |
@@ -68,10 +94,14 @@ jobs: |
68 | 94 | with: |
69 | 95 | distribution: 'temurin' |
70 | 96 | 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) |
72 | 102 | run: | |
73 | 103 | cd targetrepo |
74 | | - ./gradlew assembleDebug || ./gradlew build |
| 104 | + ./gradlew assembleRelease |
75 | 105 | - name: Upload APKs if present |
76 | 106 | uses: actions/upload-artifact@v4 |
77 | 107 | with: |
|
0 commit comments