Skip to content

Simplifies Dockerfile and fix GitHub runner space #2142

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

Merged
merged 1 commit into from
Apr 18, 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
18 changes: 18 additions & 0 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,15 @@ jobs:
steps:
- name: Checkout python-for-android
uses: actions/checkout@v2
# helps with GitHub runner getting out of space
- name: Free disk space
run: |
df -h
sudo swapoff -a
sudo rm -f /swapfile
sudo apt -y clean
docker rmi $(docker image ls -aq)
df -h
- name: Pull docker image
run: |
make docker/pull
Expand All @@ -75,6 +84,15 @@ jobs:
uses: actions/checkout@v2
with:
ref: 'develop'
# helps with GitHub runner getting out of space
- name: Free disk space
run: |
df -h
sudo swapoff -a
sudo rm -f /swapfile
sudo apt -y clean
docker rmi $(docker image ls -aq)
df -h
- name: Pull docker image
run: |
make docker/pull
Expand Down
8 changes: 1 addition & 7 deletions Dockerfile.py3 → Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# - python-for-android dependencies
#
# Build with:
# docker build --tag=p4a --file Dockerfile.py3 .
# docker build --tag=p4a --file Dockerfile .
#
# Run with:
# docker run -it --rm p4a /bin/sh -c '. venv/bin/activate && p4a apk --help'
Expand Down Expand Up @@ -71,8 +71,6 @@ RUN dpkg --add-architecture i386 \
openjdk-8-jdk \
patch \
pkg-config \
python \
python-pip \
Comment on lines -74 to -75
Copy link
Member

Choose a reason for hiding this comment

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

Oh boy, we still have some Python2 leftovers...nice that you remove that 😄

python3 \
python3-dev \
python3-pip \
Expand All @@ -95,10 +93,6 @@ RUN useradd --create-home --shell /bin/bash ${USER}
RUN usermod -append --groups sudo ${USER}
RUN echo "%sudo ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers

# install cython for python 2 (for python 3 it's inside the venv)
RUN pip2 install --upgrade Cython==0.28.6 \
&& rm -rf ~/.cache/

Comment on lines -98 to -101
Copy link
Member

Choose a reason for hiding this comment

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

More removed Python2 leftovers 👍

WORKDIR ${WORK_DIR}
RUN mkdir ${ANDROID_HOME} && chown --recursive ${USER} ${HOME_DIR} ${ANDROID_HOME}
USER ${USER}
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ docker/pull:
docker pull $(DOCKER_IMAGE):latest || true

docker/build:
docker build --cache-from=$(DOCKER_IMAGE) --tag=$(DOCKER_IMAGE) --file=Dockerfile.py3 .
docker build --cache-from=$(DOCKER_IMAGE) --tag=$(DOCKER_IMAGE) .

docker/push:
docker push $(DOCKER_IMAGE)
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ python-for-android
==================

[![Build Status](https://travis-ci.org/kivy/python-for-android.svg?branch=develop)](https://travis-ci.org/kivy/python-for-android)
[![Unit tests & build apps](https://github.com/kivy/python-for-android/workflows/Unit%20tests%20&%20build%20apps/badge.svg?branch=develop)](https://github.com/kivy/python-for-android/actions?query=workflow%3A%22Unit+tests+%26+build+apps%22)
Copy link
Member

Choose a reason for hiding this comment

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

Anxious to see how it will look like this badge 👍

Copy link
Member Author

Choose a reason for hiding this comment

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

ahah, you could actually see it from my fork/branch https://github.com/AndreMiras/python-for-android/tree/feature/python2_drop_follow_up
But you will see soon enough as I'm merging, thanks for the review :)

[![Coverage Status](https://coveralls.io/repos/github/kivy/python-for-android/badge.svg?branch=develop&kill_cache=1)](https://coveralls.io/github/kivy/python-for-android?branch=develop)
[![Backers on Open Collective](https://opencollective.com/kivy/backers/badge.svg)](#backers)
[![Sponsors on Open Collective](https://opencollective.com/kivy/sponsors/badge.svg)](#sponsors)
Expand Down