1+ name : CI
2+
3+ on :
4+ push :
5+ branches : [ master ]
6+ pull_request :
7+ branches : [ '**' ]
8+
9+ jobs :
10+ build :
11+ runs-on : ubuntu-latest
12+ container :
13+ image : mbgl/android-sdk:latest
14+ steps :
15+ - name : Checkout repository
16+ uses : actions/checkout@v4
17+
18+ - name : Check code style
19+ run : make checkstyle
20+
21+ - name : Run Lint
22+ run : ./gradlew lint
23+
24+ - name : Run unit-test in Android libraries
25+ run : make test
26+
27+ - name : Upload reports
28+ uses : actions/upload-artifact@v4
29+ with :
30+ name : reports
31+ path : app/build/reports
32+
33+ - name : Upload test results
34+ uses : actions/upload-artifact@v4
35+ with :
36+ name : test-results
37+ path : app/build/test-results
38+
39+ # release:
40+ # runs-on: ubuntu-latest
41+ # container:
42+ # image: mbgl/android-ndk-r21e:latest
43+ # if: github.event_name == 'push' && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/v'))
44+ # steps:
45+ # - uses: actions/checkout@v3
46+ #
47+ # - name: Init aws with mbx-ci
48+ # run: |
49+ # curl -Ls https://mapbox-release-engineering.s3.amazonaws.com/mbx-ci/latest/mbx-ci-linux-amd64 > mbx-ci && chmod 755 ./mbx-ci
50+ # ./mbx-ci aws setup
51+ #
52+ # - name: Update version name
53+ # run: |
54+ # if [[ $GITHUB_REF == refs/tags/v* ]]; then
55+ # VERSION_NAME=${GITHUB_REF#refs/tags/v}
56+ # sed -i -e "s/^VERSION_NAME=.*/VERSION_NAME=${VERSION_NAME}/" library/gradle.properties
57+ # elif [[ $GITHUB_REF == refs/heads/master ]]; then
58+ # COMMIT_SHA=$(git rev-parse --short HEAD)
59+ # sed -i -e "s/-SNAPSHOT.*/-${COMMIT_SHA}-SNAPSHOT/" library/gradle.properties
60+ # fi
61+ #
62+ # - name: Build libraries
63+ # run: make release
64+ #
65+ # - name: Publish to the SDK registry
66+ # env:
67+ # GITHUB_TOKEN: ${{ secrets.SDK_REGISTRY_TOKEN }}
68+ # run: |
69+ # git config --global user.email "MapboxCI@users.noreply.github.com"
70+ # git config --global user.name "MapboxCI"
71+ # if [[ $GITHUB_REF == refs/heads/master ]] || [[ $GITHUB_REF == refs/tags/v* ]]; then
72+ # make sdkRegistryUpload
73+ # fi
74+ # if [[ $GITHUB_REF == refs/tags/v* ]]; then
75+ # make sdkRegistryPublish
76+ # fi
0 commit comments