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

Document Github Action #56

Merged
merged 4 commits into from
May 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
17 changes: 17 additions & 0 deletions .github/workflows/ci_action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,20 @@ jobs:
id: docker-android-action
with:
exec: sh tests/run_tests.sh --android-api 29 --android-ndk --android-build-tools 29.0.3
build_and_test_multiline:
runs-on: ubuntu-18.04
container:
image: docker://docker:stable-git
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Test action
uses: ./action
id: docker-android-action
with:
exec: |
echo "Running Android 29 NDK Tests";
sh tests/run_tests.sh --android-api 29 --android-ndk --android-build-tools 29.0.3;
echo "Running Android 29 Tests";
sh tests/run_tests.sh --android-api 29 --android-build-tools 29.0.3;
33 changes: 32 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ The image is providing standard tools to build and test Android application:
| [Circle CI](https://circleci.com/docs/2.0/executor-types/#using-docker) | 🚧 |
| [Travis CI](https://travis-ci.com/) | 🚧 |

## 🐙 GitHub Action Sample
## 🐙 GitHub Workflow Sample
Github workflows can run inside Docker images using `container` attribute after `runs-on`:
```yml
name: GitHub Action sample

Expand Down Expand Up @@ -69,6 +70,36 @@ jobs:
- name: Cache workaround # https://github.com/actions/cache/issues/133
run: chmod -R a+rwx .
```
You can also use the provided Github Action.
However, caching won't work and you can expect longer build times.
`docker-android-tag` should be one of the tags found in [Fabernovel Hub Registry Tags](https://hub.docker.com/r/fabernovel/android/tags)
```
name: GitHub Action sample

on:
push:
branches:
- develop

jobs:
build_test_and_deploy:
runs-on: ubuntu-18.04 # Works also with self hosted runner supporting docker
container:
image: docker://docker:stable-git

steps:
- name: Checkout
uses: actions/checkout@v2.1.0

- name: Test action
uses: fabernovel/docker-android
vincentbrison marked this conversation as resolved.
Show resolved Hide resolved
id: docker-android-action
with:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should add the tag parameter in example as it might be important to define which docker image to use here.

docker-android-tag: api-29-ndk-v1.0.0
exec: |
bundle install;
bundle exec fastlane my_lane
```

## 📦 Container Registry
docker-android images are hosted on [DockerHub](https://hub.docker.com/repository/docker/fabernovel/android).
Expand Down