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 49 commits into
base: trunk
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
5517bd1
refactor:build:Introduce github actions builds
jkoan Oct 4, 2021
89c6996
Fix:build:Fixed indent
jkoan Oct 4, 2021
85cd19b
Add:build:Add Rviewdog to have automatic Formating suggestions
jkoan Oct 4, 2021
7c6bd9e
Fix: Fetch all Braches to be able to compare to trunk
jkoan Oct 4, 2021
b86577f
Change:build:remove reset
jkoan Oct 4, 2021
704cceb
fix:Sanity_check:Update .github/workflows/build.yml
jkoan Oct 4, 2021
2935096
change:build:deactivated as somethings broken with gradlew checkstyle
jkoan Oct 4, 2021
024e42a
fix
jkoan Oct 4, 2021
c69817a
Deactivate upload as well, as CheckStyle is not yet running
jkoan Oct 4, 2021
c8e4011
add sudo
jkoan Oct 4, 2021
ebb3632
fixed:build:Added skd and add ndk to path. Also install java
jkoan Oct 5, 2021
4e782fd
try to get history as well
jkoan Oct 5, 2021
d724fda
fix syntax
jkoan Oct 5, 2021
9cbb642
mixed lane names
jkoan Oct 5, 2021
f57dd09
try to add ndkVersion to automatically get ndk
jkoan Oct 5, 2021
1b2af27
Update Gradle
jkoan Oct 5, 2021
24d3060
update wrapper
jkoan Oct 5, 2021
81e33b5
Try to fix Lint error with getColumnIndexOrThrow instead of getColumn…
jkoan Oct 6, 2021
e1d4ff8
change:build:reenable sailfishos as its working with act now
jkoan May 23, 2022
978e342
Add:build:android:Add ndk install
jkoan Jun 7, 2022
80df701
fix:build:android:Make build compatible with act (https://github.com/…
jkoan Jun 12, 2022
46d0a08
fix:build:android:Fix setup and build of/with ndk
jkoan Jun 12, 2022
8934f8d
fix:build:android:install sudo only if UID is 0 as act is slightly di…
jkoan Jun 12, 2022
6827b67
fix:build:android:run gem install with as root
jkoan Jun 12, 2022
b42cf11
fix:build:android:Fix upload paths
jkoan Jun 12, 2022
ca111fd
fix:build:android:Remove debug code
jkoan Jun 12, 2022
dc6c1c4
debug
jkoan Jun 12, 2022
b2708da
debug
jkoan Jun 12, 2022
44ff8ba
Revert "debug"
jkoan Jun 12, 2022
41024be
fix:build:Fix checkout on wince and sailfish
jkoan Jun 12, 2022
584c50c
fix:build:Add name of artifact to be able to upload
jkoan Jun 12, 2022
37bd3d9
fix:build:sailfish:Repeat image change from #1183
jkoan Jun 12, 2022
43ec4b9
Fix:build:sailfish:Run with bash
jkoan Jun 14, 2022
c2ff7f2
Fix:build:sailfish:Remove ls of non existing dir
jkoan Jun 14, 2022
d2997ef
try run with sudo...
jkoan Jun 14, 2022
7a1f200
try keeping env
jkoan Jun 14, 2022
dd0cb26
try bash with -x to better debug whats going on... on act its working
jkoan Jun 14, 2022
b0fea38
next try
jkoan Jun 14, 2022
3dd6375
fix:build:sailfish:Fix Target config
jkoan Jun 14, 2022
4f73de7
try change home
jkoan Jun 14, 2022
c01e0b5
try 4.4.0.64
jkoan Jun 14, 2022
b7d66ed
remove tmp fix
jkoan Jun 14, 2022
1268dbd
Update actions/upload-artifact to v4
jkoan Dec 20, 2024
e33aebb
Update Rest of uploads as well
jkoan Dec 20, 2024
10e7fa1
Update wince to new image
jkoan Dec 20, 2024
1bf73b0
Update Win32 image and changes from #1267
jkoan Dec 20, 2024
14f064b
Pull from Maven Central
jkoan Dec 20, 2024
777d82d
Upldate to newer image
jkoan Dec 20, 2024
676f746
Update build.yml
jkoan Dec 20, 2024
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
231 changes: 231 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,231 @@

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@v4
# 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@v4
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@v4
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@v4
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@v4
with:
name: Store APK
path: build/outputs/apk
- uses: actions/upload-artifact@v4
with:
name: Store logs
path: build/outputs/logs
- uses: actions/upload-artifact@v4
with:
name: Store Javadoc
path: build/outputs/docs/javadoc
- uses: actions/upload-artifact@v4
with:
name: Store Lint reports
path: build/reports
- uses: actions/upload-artifact@v4
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:24.04
steps:
- uses: actions/checkout@v2
- run: |
apt-get update && apt-get install -y git
- name: Prepare the Windows build environment
run: bash scripts/setup_win32.sh
- name: Build for Windows
run: |
bash scripts/build_win32.sh
- uses: actions/upload-artifact@v4
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: ghcr.io/enlyze/windows-ce-build-environment-arm
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@v4
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: ghcr.io/navit-gps/tomtom:master
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@v4
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: ghcr.io/navit-gps/tomtom:master
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@v4
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
2 changes: 1 addition & 1 deletion gradle/scripts/git-scm-version.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

buildscript {
repositories {
jcenter()
mavenCentral()
}
dependencies {
classpath 'org.ajoberstar:grgit:2.3.0'
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