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

Introduce GitHub actions #1162

wants to merge 49 commits into from

Conversation

jkoan
Copy link
Member

@jkoan jkoan commented Oct 4, 2021

This is the first take on Github Actions. The goal is to migrate all our builds to it as CircleCI has issues for a long time.
The most prominent is that when opening a PR no Builds are done, or those are not reported back to Github Checks.
On the other Hand Github Actions is obviously perfectly integrated and therefor has additional advantages, like allowing to start workfows, suggestins and many more.
Some of those will be integrated into this PR. The first and most notable one will be that the Build Sanity Check will now post Formatting errors back to the Contributor (within the PR) so that they can be applied with a single click.

@jkoan jkoan changed the title Intorduce GitHub actions Introduce GitHub actions Oct 4, 2021
@jkoan
Copy link
Member Author

jkoan commented Oct 6, 2021

@mvglasow @jandegr could you make sense of this Lint Error? https://github.com/navit-gps/navit/pull/1162/checks?check_run_id=3802624465 i looked it up, but its apparently a error in the Linter with some Versions. But i don't see any config where we directly define the Linter Version used.

@mvglasow
Copy link
Contributor

mvglasow commented Oct 6, 2021

Error:   /home/runner/work/navit/navit/navit/android/src/org/navitproject/navit/NavitTraff.java:360: Error: Value must be ≥ 0 [Range]
                  builder.append(cursor.getString(cursor.getColumnIndex(COLUMN_DATA))).append("\n");
                                                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Lint apparently complains because it expects to see a non-negative argument for cursor.getString(). Instead of a numeric argument, we are using the return value of cursor.getColumnIndex() with a String constant argument. In practice, this works well as long as the cursor has a column named data (which is the value of COLUMN_DATA).

This might not be the most elegant way of coding it. A way to get rid of the lint warning would be something like:

int columnDataIndex = cursor.getColumnIndex(COLUMN_DATA);
if (columnDataIndex < 0) {
    // some error handling here
} else {
    builder.append(cursor.getString(columnDataIndex)).append("\n");
}

If someone wants to take a stab a this, feel free – I can’t currently dedicate much time to Navit (unfortunately).

@jkoan jkoan force-pushed the github_actions branch 2 times, most recently from e88c52e to 981b5d0 Compare May 24, 2022 12:20
@jkoan jkoan linked an issue Jan 1, 2023 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable to merge PRs from remote branches because CI stalls
2 participants