-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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 (push & pull_requests) #2025
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
508e94d
[actions] Add push workflow (linting)
opacam 23b8907
[actions] Fix `expected compiler` for tests
opacam 3b6448f
[actions] Mock environ variables for `test_create_no_sdk_dir`
opacam 5e0d7ed
[actions] Fix `test_toolchain.test_create` for macos
opacam f0d6a62
[actions] Fix venv/virtualenv tests
opacam 23d35a6
[actions] Add build stage: pull docker image & build an testapp
opacam 3611a9e
[actions] Make flake8 tests via tox
opacam 4f0f86a
[actions] Run pytest via tox
opacam 8416bfe
[actions] Reintroduce `COVERALLS_REPO_TOKEN`
opacam b9e66ea
[actions] Make tox tests via Makefile
opacam 643a7f7
[actions] Add `rebuild updated recipes` test
opacam c6c3ea8
[actions] Shorten long line below 79 characters for libtorrent
opacam 0a93908
[actions] Revert "[actions] Shorten long line ..."
opacam File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
name: Unit tests & Build Testapp | ||
|
||
on: ['push', 'pull_request'] | ||
|
||
jobs: | ||
|
||
flake8: | ||
name: Flake8 tests | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout python-for-android | ||
uses: actions/checkout@master | ||
- name: Set up Python 3.7 | ||
uses: actions/setup-python@v1.1.0 | ||
with: | ||
python-version: 3.7 | ||
- name: Run flake8 | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install tox>=2.0 | ||
tox -e pep8 | ||
|
||
test: | ||
name: Pytest [Python ${{ matrix.python-version }} | ${{ matrix.os }}] | ||
needs: flake8 | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
python-version: [3.6, 3.7] | ||
os: [ubuntu-latest, macOs-latest] | ||
steps: | ||
- name: Checkout python-for-android | ||
uses: actions/checkout@master | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v1.1.0 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Tox tests | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install tox>=2.0 | ||
make test | ||
|
||
build: | ||
name: Build testapp | ||
needs: [flake8] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout python-for-android | ||
uses: actions/checkout@master | ||
- name: Pull docker image | ||
run: | | ||
make docker/pull | ||
- name: Build apk for Python 3 arm64-v8a | ||
run: | | ||
make docker/run/make/testapps/python3/arm64-v8a | ||
|
||
rebuild_updated_recipes: | ||
name: Test updated recipes | ||
needs: [flake8] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout python-for-android | ||
uses: actions/checkout@master | ||
- name: Pull docker image | ||
run: | | ||
make docker/pull | ||
- name: Rebuild updated recipes | ||
run: | | ||
make docker/run/make/rebuild_updated_recipes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
from unittest import mock | ||
from platform import system | ||
from tests.recipes.recipe_ctx import RecipeCtx | ||
|
||
|
||
|
@@ -13,7 +14,7 @@ class BaseTestForMakeRecipe(RecipeCtx): | |
|
||
recipe_name = None | ||
expected_compiler = ( | ||
"{android_ndk}/toolchains/llvm/prebuilt/linux-x86_64/bin/clang" | ||
"{android_ndk}/toolchains/llvm/prebuilt/{system}-x86_64/bin/clang" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So basically unit test was failing in osx? Maybe it could be a PR on its own with these fixes |
||
) | ||
|
||
sh_command_calls = ["./configure"] | ||
|
@@ -48,7 +49,7 @@ def test_get_recipe_env( | |
some internal methods has been called. | ||
""" | ||
mock_find_executable.return_value = self.expected_compiler.format( | ||
android_ndk=self.ctx._ndk_dir | ||
android_ndk=self.ctx._ndk_dir, system=system().lower() | ||
) | ||
mock_glob.return_value = ["llvm"] | ||
mock_check_recipe_choices.return_value = sorted( | ||
|
@@ -85,7 +86,7 @@ def test_build_arch( | |
mock_current_directory, | ||
): | ||
mock_find_executable.return_value = self.expected_compiler.format( | ||
android_ndk=self.ctx._ndk_dir | ||
android_ndk=self.ctx._ndk_dir, system=system().lower() | ||
) | ||
mock_glob.return_value = ["llvm"] | ||
|
||
|
@@ -133,7 +134,7 @@ def test_build_arch( | |
mock_current_directory, | ||
): | ||
mock_find_executable.return_value = self.expected_compiler.format( | ||
android_ndk=self.ctx._ndk_dir | ||
android_ndk=self.ctx._ndk_dir, system=system().lower() | ||
) | ||
mock_glob.return_value = ["llvm"] | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't the branch be
develop
here and the other places? Or this is not related to the p4a branch?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aaa...first of all, I'm not an gh-actions expert at all, but, I will try to put some light in here, so here we go:
gh-actions
works based on events (In this PR we listen and react topush
andpull_requests
github events...so we kind of imitate travis behaviour). But, there is a lot of events that we can use, just check this if you want to get more detailed info about events.gh-actions
is not just a name, it's a set of repos: https://github.com/actions. Those repos can be used by any other repo.Said this, when we call the line:
uses: actions/checkout@master
What are we doing is executing the code located at: https://github.com/actions/checkout, which simply will run the proper git commands, so our workflow can access the content of our repo. The
@master
just point to the version that we use for the specific github action (master branch in this case but it could be a release...).Ok, hope that this clarifies a little this particular
gh-actions
thing 😉There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes it clarifies, I was exactly not sure if this branch was our or the tooling one, thanks 👍