github: Migrate from Travis CI to Github Actions
[strongswan.git] / .github / workflows / android.yml
1 name: Android
2
3 on: [push, pull_request]
4
5 env:
6   CCACHE_BASEDIR: ${{ github.workspace }}
7   CCACHE_COMPRESS: true
8   CCACHE_MAXSIZE: 400M
9   CC: gcc
10   OS_NAME: linux
11
12 jobs:
13   android:
14     runs-on: ubuntu-latest
15     env:
16       TEST: android
17       # since the NDK is newly installed every time, we have to use this to avoid cache misses
18       CCACHE_COMPILERCHECK: content
19     steps:
20       # even though we don't specify a specific version in our gradle files, the
21       # build fails without this because some arbitrary NDK version, that's
22       # weirdly not installed, is requested
23       - name: Install NDK
24         run: yes | sudo ${ANDROID_HOME}/tools/bin/sdkmanager --install 'ndk;21.0.6113669'
25       - uses: actions/checkout@v2
26       - uses: actions/cache@v2
27         with:
28           path: ~/.ccache
29           key: ccache-android-${{ github.ref }}:${{ github.sha }}
30           restore-keys: |
31             ccache-android-${{ github.ref }}:
32             ccache-android-
33       - run: |
34           sudo apt-get install -qq ccache
35           echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV
36           ccache -z
37       - uses: ./.github/actions/default
38       - run: ccache -s
39       - if: ${{ success() }}
40         uses: actions/upload-artifact@v2
41         with:
42           name: Lint Results
43           path: src/frontends/android/app/build/reports/lint-results.xml