Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce GitHub actions #1162

Draft
wants to merge 42 commits into
base: trunk
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
a8dc917
refactor:build:Introduce github actions builds
jkoan Oct 4, 2021
7799109
Fix:build:Fixed indent
jkoan Oct 4, 2021
7981c0c
Add:build:Add Rviewdog to have automatic Formating suggestions
jkoan Oct 4, 2021
f678941
Fix: Fetch all Braches to be able to compare to trunk
jkoan Oct 4, 2021
2aba1cf
Change:build:remove reset
jkoan Oct 4, 2021
2dc3174
fix:Sanity_check:Update .github/workflows/build.yml
jkoan Oct 4, 2021
1d976f7
change:build:deactivated as somethings broken with gradlew checkstyle
jkoan Oct 4, 2021
b8803a0
fix
jkoan Oct 4, 2021
29ff9ab
Deactivate upload as well, as CheckStyle is not yet running
jkoan Oct 4, 2021
d8d46c5
add sudo
jkoan Oct 4, 2021
db42177
fixed:build:Added skd and add ndk to path. Also install java
jkoan Oct 5, 2021
aabb937
try to get history as well
jkoan Oct 5, 2021
5738d09
fix syntax
jkoan Oct 5, 2021
73257e4
mixed lane names
jkoan Oct 5, 2021
d9e0f23
try to add ndkVersion to automatically get ndk
jkoan Oct 5, 2021
feb29b7
Update Gradle
jkoan Oct 5, 2021
f62bb96
update wrapper
jkoan Oct 5, 2021
6f6ec6a
Try to fix Lint error with getColumnIndexOrThrow instead of getColumn…
jkoan Oct 6, 2021
326b015
change:build:reenable sailfishos as its working with act now
jkoan May 23, 2022
6e3bb02
Add:build:android:Add ndk install
jkoan Jun 7, 2022
4b14091
fix:build:android:Make build compatible with act (https://github.com/…
jkoan Jun 12, 2022
972566b
fix:build:android:Fix setup and build of/with ndk
jkoan Jun 12, 2022
7873e83
fix:build:android:install sudo only if UID is 0 as act is slightly di…
jkoan Jun 12, 2022
9cded32
fix:build:android:run gem install with as root
jkoan Jun 12, 2022
6d24a1f
fix:build:android:Fix upload paths
jkoan Jun 12, 2022
680e3d4
fix:build:android:Remove debug code
jkoan Jun 12, 2022
4fff983
debug
jkoan Jun 12, 2022
3ca3e26
debug
jkoan Jun 12, 2022
cb67a11
Revert "debug"
jkoan Jun 12, 2022
818e97e
fix:build:Fix checkout on wince and sailfish
jkoan Jun 12, 2022
c822c8d
fix:build:Add name of artifact to be able to upload
jkoan Jun 12, 2022
a9d0495
fix:build:sailfish:Repeat image change from #1183
jkoan Jun 12, 2022
fd1fe9f
Fix:build:sailfish:Run with bash
jkoan Jun 14, 2022
f8b1218
Fix:build:sailfish:Remove ls of non existing dir
jkoan Jun 14, 2022
c6e10d2
try run with sudo...
jkoan Jun 14, 2022
185af7d
try keeping env
jkoan Jun 14, 2022
ecd140d
try bash with -x to better debug whats going on... on act its working
jkoan Jun 14, 2022
09fc06e
next try
jkoan Jun 14, 2022
b3bdcb9
fix:build:sailfish:Fix Target config
jkoan Jun 14, 2022
23356ae
try change home
jkoan Jun 14, 2022
74186eb
try 4.4.0.64
jkoan Jun 14, 2022
f29485b
remove tmp fix
jkoan Jun 14, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
232 changes: 232 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,232 @@

name: Build Navit Binarys

on: [push, pull_request]

jobs:
sanity_check:
runs-on: ubuntu-latest
container:
image: navit/sanity_check:latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
##- name: run sanity check script
## run: bash scripts/ci_sanity_checks.sh
##- uses: reviewdog/action-suggester@v1
## with:
## github_token: ${{ secrets.github_token }}
## tool_name: Navit sanity Check
## level: error
## fail_on_error: false
# FIXME: deactivated as somethings broken with it
#- name: Run CheckStyle Test
# run: ./gradlew checkstyleMain
#- uses: actions/upload-artifact@v1
# with:
# name: Store checkstyle report
# path: navit/android/checkstyle

build_linux:
runs-on: ubuntu-latest
needs: sanity_check
container:
image: debian:latest
steps:
- uses: actions/checkout@v2
- run: |
apt-get update && apt-get install -y git
- name: Setup requirements
run: |
bash scripts/setup_common_requirements.sh
apt-get install -y libpng-dev libfreetype6-dev libdbus-glib-1-dev libgtk2.0-dev curl
- name: Build for Linux
run: bash scripts/build_linux.sh
- uses: actions/upload-artifact@v2
with:
name: Linux Artifacts
path: linux/_CPack_Packages
- name: Update Navit-Download-Center
run: |
bash scripts/update_download_center.sh
run_doxygen:
runs-on: ubuntu-latest
needs: [build_android, build_wince, build_tomtom_minimal, build_linux, build_tomtom_plugin, build_win32]
container:
image: debian:latest
steps:
- uses: actions/checkout@v2
- name: Install doxygen and other essentials
run: apt-get update && apt-get -y install doxygen ca-certificates git rsync
- name: Run doxygen
run: cd navit && doxygen
- name: Update results to Github
run: bash scripts/update_doxygen.sh
- uses: actions/upload-artifact@v1
with:
path: /root/project/doc
build_sailfish:
runs-on: ubuntu-latest
needs: sanity_check
container:
image: coderus/sailfishos-platform-sdk:4.4.0.64
steps:
- uses: actions/checkout@v1
# TODO currently broken because of USER in Dockerimage and probably because of double containers as well
- name: run build
run: sudo -E bash contrib/sailfish/build_sailfish_ci.sh
env:
VERSION_ID: 4.4.0.64
- uses: actions/upload-artifact@v1
with:
name: Store rpm
path: rpmbuild/RPMS/
build_android:
runs-on: ubuntu-latest
needs: sanity_check
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- run: if [ "X$UID" == X0 ]; then apt update && apt install -y sudo; fi
- name: Install requirements
run: bash scripts/setup_android.sh
- name: Setup Keystore and Playstore Keys
run: scripts/setup_publish_keys.sh
- name: Setup Android SDK
uses: android-actions/setup-android@v2
- name: Install NDK
run: sdkmanager "ndk;23.0.7599858"
- name: Build and upload Android
run: fastlane github_actions
- name: Run Lint Test
run: |
ln -sf navit/navit.dtd navit.dtd
mkdir test-results
./gradlew lint test
- name: Run Javadoc
run: ./gradlew generateDebugJavadoc
- uses: actions/upload-artifact@v3
with:
name: Store APK
path: build/outputs/apk
- uses: actions/upload-artifact@v3
with:
name: Store logs
path: build/outputs/logs
- uses: actions/upload-artifact@v3
with:
name: Store Javadoc
path: build/outputs/docs/javadoc
- uses: actions/upload-artifact@v3
with:
name: Store Lint reports
path: build/reports
- uses: actions/upload-artifact@v3
with:
name: Android Test-results
path: test-results
- name: Update Navit-Download-Center
run: |
bash scripts/update_download_center.sh
build_win32:
runs-on: ubuntu-latest
needs: sanity_check
container:
image: ubuntu:16.04
steps:
- uses: actions/checkout@v2
- run: |
apt-get update && apt-get install -y git
- name: Prepare the Windows build environment
run: |
apt-get update && xargs -a scripts/setup_14.04_requirements.list apt-get install -y
apt-get install -y software-properties-common
add-apt-repository -y ppa:george-edison55/cmake-3.x
apt-get install -y cmake mingw-w64 mingw-w64-tools default-jdk nsis libsaxonb-java curl
- name: Build for Windows
run: |
bash scripts/build_win32.sh
- uses: actions/upload-artifact@v2
with:
name: Win32
path: win32/navit.exe
- name: Update Navit-Download-Center
run: |
bash scripts/update_download_center.sh
build_wince:
runs-on: ubuntu-latest
needs: sanity_check
container:
image: navit/dockerfiles:wince
steps:
- uses: actions/checkout@v1
- run: |
apt-get update && apt-get install -y git-core
- name: Prepare the WinCE build environment
run: |
bash scripts/setup_wince.sh
- name: Build for Windows CE
run: bash scripts/build_wince.sh
- uses: actions/upload-artifact@v1
with:
path: wince/output
name: WinCE Binary
- name: Update Navit-Download-Center
run: |
bash scripts/update_download_center.sh
build_tomtom_minimal:
runs-on: ubuntu-latest
needs: sanity_check
container:
image: navit/tomtom-ng
steps:
- uses: actions/checkout@v2
- name: Prepare the tomtom build environment
run: |
bash scripts/setup_common_requirements.sh
apt-get install -y xsltproc
- name: Build for Tomtom (minimal)
run: bash scripts/build_tomtom_minimal.sh
- uses: actions/upload-artifact@v2
with:
name: Tomtom Minimal
path: /output
- name: Update Navit-Download-Center
run: |
bash scripts/update_download_center.sh
build_tomtom_plugin:
runs-on: ubuntu-latest
needs: sanity_check
container:
image: navit/tomtom-ng
steps:
- uses: actions/checkout@v2
- name: Prepare the tomtom build environment
run: |
bash scripts/setup_common_requirements.sh
apt-get install -y xsltproc
- name: Build for Tomtom (plugin)
run: |
bash scripts/build_tomtom_plugin.sh
- uses: actions/upload-artifact@v2
with:
name: Tomtom Plugin
path: /output
- name: Update Navit-Download-Center
run: |
bash scripts/update_download_center.sh
merge_trunk_in_master:
runs-on: ubuntu-latest
needs: [build_android, build_wince, build_tomtom_minimal, build_linux, build_tomtom_plugin, build_win32]
if: github.ref == 'trunk'
steps:
- uses: actions/checkout@master
- name: Merge to master branch
uses: devmasx/[email protected]
with:
type: now
target_branch: 'master'
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
3 changes: 2 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ buildscript {
}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.0'
classpath 'com.android.tools.build:gradle:7.1.3'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand All @@ -38,6 +38,7 @@ task clean(type: Delete) {
android {
compileSdkVersion 29
buildToolsVersion "29.0.2"
ndkVersion "23.0.7599858"
signingConfigs {
release {
// We can leave these in environment variables
Expand Down
2 changes: 1 addition & 1 deletion contrib/sailfish/build_sailfish_ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ if [ -z ${VERSION_ID+x} ]; then echo "VERSION_ID not set. Forgot to export VERSI
# Makes calling it directly from docker easier.
SCRIPTPATH="$( cd "$(dirname "$0")" ; pwd -P )"
cd $SCRIPTPATH
ls -lah /navit

mkdir $HOME/rpmbuild

#arm devices
Expand Down
11 changes: 9 additions & 2 deletions fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,24 @@ end

platform :android do
desc "Description of what the lane does"
lane :github_actions do
# Here we can add other things that Github Actions should do
build
end
lane :circleci do
# Here we can add other things that circleci should do
# Here we can add other things that CircleCI should do
build
playstore
end
lane :playstore do
lane :build do
sh("cd ..;bash scripts/build_android.sh")

gradle(
task: 'assemble',
build_type: 'Release'
)
end
lane :playstore do
isOnMasterBranch = currentBranch() == "master"
isOnMasterBranch = false # Workarount do not push to google as its curently broken
if isOnMasterBranch
Expand Down
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6-all.zip
distributionSha256Sum=33214524e686838c88a88e14e8b30e2323589cc9698186bc8e0594758b132b31
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-all.zip
distributionSha256Sum=a8da5b02437a60819cad23e10fc7e9cf32bcb57029d9cb277e26eeff76ce014b
2 changes: 1 addition & 1 deletion navit/android/src/org/navitproject/navit/NavitTraff.java
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ private void fetchMessages(Context context, Uri uri) {
}
StringBuilder builder = new StringBuilder("<feed>\n");
while (cursor.moveToNext())
builder.append(cursor.getString(cursor.getColumnIndex(COLUMN_DATA))).append("\n");
builder.append(cursor.getString(cursor.getColumnIndexOrThrow(COLUMN_DATA))).append("\n");
builder.append("</feed>");
cursor.close();
onFeedReceived(mCbid, builder.toString());
Expand Down
4 changes: 1 addition & 3 deletions scripts/ci_sanity_checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ check_diff(){
if [[ $code -ne 0 ]]; then
echo "[ERROR] You may need to do some cleanup in the files you commited, see the git diff output above."
fi
git checkout -- .
return_code=$(($return_code + $code))
}

Expand Down Expand Up @@ -57,5 +56,4 @@ for f in $(git diff --name-only refs/remotes/origin/trunk | sort -u); do
fi
fi
done

exit $return_code
git diff
5 changes: 3 additions & 2 deletions scripts/setup_android.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
set -e

sudo apt-get update
sudo apt-get install -y cmake gettext libsaxonb-java librsvg2-bin pkg-config rename
gem install --no-document fastlane git
sudo apt-get install -y cmake gettext libsaxonb-java librsvg2-bin pkg-config rename ruby ruby-dev build-essential rake-compiler git default-jdk-headless
sudo gem install rake
sudo gem install --no-document fastlane git

Loading