@@ -2,15 +2,23 @@ name: OpenDocument-Reader-Android
22
33on :
44 workflow_dispatch :
5- pull_request :
5+ push :
66 paths-ignore :
77 - ' **.md'
8- push :
8+ - ' .github/**'
9+ - ' !.github/workflows/android_main.yml'
10+ branches :
11+ - main
12+ pull_request :
913 paths-ignore :
1014 - ' **.md'
1115 - ' .github/**'
1216 - ' !.github/workflows/android_main.yml'
1317
18+ concurrency :
19+ group : ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
20+ cancel-in-progress : true
21+
1422jobs :
1523 build :
1624 runs-on : ubuntu-20.04
@@ -19,49 +27,59 @@ jobs:
1927 - name : checkout
2028 uses : actions/checkout@v3
2129
22- - name : ninja
30+ - name : install ninja
2331 run : sudo apt-get install -y ninja-build
24- - name : java
32+ - name : setup java
2533 uses : actions/setup-java@v3
2634 with :
2735 distribution : ' zulu'
28- java-version : 11
36+ java-version : 17
2937
30- - name : set up python 3.8
38+ - name : setup python 3.8
3139 uses : actions/setup-python@v4
3240 with :
3341 python-version : 3.8
3442
3543 - name : install pip and conan
36- run : python -m pip install --upgrade pip conan
37- - name : conan revisions
44+ run : python -m pip install --upgrade pip conan==1.*
45+
46+ - name : conan config
3847 run : conan config set general.revisions_enabled=1
3948 - name : conan repo
40- run : conan remote add odr https://odr.jfrog.io/artifactory/api/conan/odr-conan
49+ run : conan remote add odr https://artifactory.opendocument.app/artifactory/api/conan/conan
50+
51+ - name : tweak conan profile for build machine
52+ run : |
53+ echo "" >> conanprofile_build.txt
54+ echo "[settings]" >> conanprofile_build.txt
55+ echo "compiler=clang" >> conanprofile_build.txt
56+ echo "compiler.libcxx=libstdc++11" >> conanprofile_build.txt
57+ echo "" >> conanprofile_build.txt
4158
42- - run : ./gradlew assembleDebug lintProDebug lintLiteDebug --stacktrace
59+ - name : gradle
60+ run : ./gradlew assembleDebug lintProDebug lintLiteDebug --stacktrace
4361
44- - uses : actions/upload-artifact@v3
62+ - name : upload apks
63+ uses : actions/upload-artifact@v3
4564 with :
4665 name : APKs
4766 path : app/build/outputs/apk/**/*.apk
4867 if-no-files-found : error
4968
50- - uses : actions/upload-artifact@v3
69+ - name : upload lint results
70+ uses : actions/upload-artifact@v3
5171 with :
5272 name : lint-report
5373 path : app/build/reports/lint-results-*.html
5474 if-no-files-found : error
75+
5576 test :
5677 runs-on : macos-11
5778 strategy :
5879 fail-fast : false
5980 # Make sure the matrix here and in cache_AVD_images.yml is the same
6081 matrix :
6182 include :
62- # Oldest version we support
63- - arch : x86
64- api-level : 19
6583 # Oldest x86_64
6684 - arch : x86_64
6785 api-level : 21
@@ -81,28 +99,37 @@ jobs:
8199 uses : actions/setup-java@v3
82100 with :
83101 distribution : ' zulu'
84- java-version : 11
102+ java-version : 17
85103
86- - name : brew
104+ - name : install brew
87105 run : ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" < /dev/null 2> /dev/null
88106 - name : fix ninja install
89107 run : rm '/usr/local/bin/2to3'
90- - name : ninja
108+ - name : install ninja
91109 run : brew install ninja
92110 # https://stackoverflow.com/a/57758679/198996
93- - name : bundler
111+ - name : install bundler
94112 run : gem install bundler:1.17.3
95- - name : fastlane
113+ - name : install fastlane
96114 run : bundle install
97115
98- - name : pip
116+ - name : install pip
99117 run : python3 -m ensurepip
100- - name : conan
101- run : pip3 install conan
102- - name : conan revisions
118+ - name : install conan
119+ run : pip3 install --upgrade conan==1.*
120+
121+ - name : conan config
103122 run : conan config set general.revisions_enabled=1
104123 - name : conan repo
105- run : conan remote add odr https://odr.jfrog.io/artifactory/api/conan/odr-conan
124+ run : conan remote add odr https://artifactory.opendocument.app/artifactory/api/conan/conan
125+
126+ - name : tweak conan profile for build machine
127+ run : |
128+ echo "" >> conanprofile_build.txt
129+ echo "[settings]" >> conanprofile_build.txt
130+ echo "compiler=clang" >> conanprofile_build.txt
131+ echo "compiler.libcxx=libc++" >> conanprofile_build.txt
132+ echo "" >> conanprofile_build.txt
106133
107134 - name : Android Virtual Device (AVD) cache
108135 uses : actions/cache@v3
@@ -152,7 +179,8 @@ jobs:
152179
153180 test ! -f sorry_but_tests_are_failing
154181
155- - uses : actions/upload-artifact@v3
182+ - name : upload test results
183+ uses : actions/upload-artifact@v3
156184 if : always()
157185 with :
158186 name : testResults-${{ matrix.api-level }}-${{ matrix.arch }}
0 commit comments