1+ name : android-ci
2+
3+ on :
4+ push :
5+ branches :
6+ - develop
7+ paths-ignore :
8+ - " app/src/main/**"
9+ - " scripts/emoji_generator/**"
10+ pull_request :
11+ branches :
12+ - develop
13+ paths-ignore :
14+ - " app/src/main/**"
15+ - " scripts/emoji_generator/**"
16+
17+ env :
18+ CI : true
19+
20+ jobs :
21+ wrapper-validation :
22+ name : Wrapper validation
23+ runs-on : ubuntu-latest
24+ steps :
25+ - uses : actions/checkout@v5
26+ - uses : gradle/actions/wrapper-validation@v4
27+
28+ spotless :
29+ needs : wrapper-validation
30+ runs-on : ubuntu-latest
31+ steps :
32+ - uses : ./.github/actions/android
33+ - name : Run spotless check
34+ run : ./gradlew spotlessCheck
35+
36+ gradle-dokka :
37+ name : Generate and deploy docs
38+ needs : wrapper-validation
39+ if : github.event_name == 'push'
40+ runs-on : ubuntu-latest
41+ steps :
42+ - uses : actions/create-github-app-token@v2
43+ id : app-token
44+ with :
45+ app-id : ${{ secrets.APP_ID }}
46+ private-key : ${{ secrets.APP_PRIVATE_KEY }}
47+ - uses : actions/checkout@v5
48+ - uses : ./.github/actions/android
49+ - name : Grant execute permission for gradlew
50+ run : chmod +x gradlew
51+ - name : Generate docs with dokka
52+ run : ./gradlew dokkaHtmlMultiModule
53+ - name : Deploy 🚀
54+ uses : JamesIves/github-pages-deploy-action@v4.7.3
55+ with :
56+ branch : docs # The branch the action should deploy to.
57+ folder : dokka-docs # The folder the action should deploy.
58+ token : ${{ steps.app-token.outputs.token }}
59+
60+ unit-test :
61+ name : Unit Tests
62+ needs : [wrapper-validation, spotless]
63+ runs-on : ubuntu-latest
64+ steps :
65+ - uses : actions/create-github-app-token@v2
66+ id : app-token
67+ with :
68+ app-id : ${{ secrets.APP_ID }}
69+ private-key : ${{ secrets.APP_PRIVATE_KEY }}
70+ - uses : actions/checkout@v5
71+ - uses : ./.github/actions/android
72+ - name : Run tests
73+ run : |
74+ ./gradlew emojify:preTest
75+ ./gradlew emojify:test --stacktrace
76+ ./gradlew emojify:postTest
77+ - name : Publish Test Report
78+ uses : mikepenz/action-junit-report@v5
79+ if : always()
80+ with :
81+ report_paths : ' **/build/test-results/**/TEST-*.xml'
82+ token : ${{ steps.app-token.outputs.token }}
83+
84+ publish-artifact :
85+ name : Publish Artifact
86+ needs : unit-test
87+ if : github.event_name == 'push'
88+ runs-on : ubuntu-latest
89+ steps :
90+ - uses : ./.github/actions/android
91+ - name : Run build
92+ run : |
93+ ./gradlew emojify:preTest
94+ ./gradlew clean build --stacktrace
95+ ./gradlew emojify:postTest
96+ - name : Publish to Local Maven
97+ run : |
98+ ./gradlew publishMavenPublicationToMavenLocal
99+ - name : Upload artifacts
100+ uses : actions/upload-artifact@v4
101+ with :
102+ name : publications
103+ path : ~/.m2/repository/io/wax911/emoji/
0 commit comments