Skip to content

Commit

Permalink
CI: Add Arm Raspbian job that installs Mu in system Python.
Browse files Browse the repository at this point in the history
In addition to the jobs installing it in a virtual environment.
  • Loading branch information
carlosperate committed Dec 29, 2021
1 parent 6236d74 commit 02ff486
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 8 deletions.
32 changes: 25 additions & 7 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,12 @@ jobs:
"
test-pios:
name: Test Raspbian ${{ matrix.docker-tag }}
name: Test PiOS ${{ matrix.docker-tag }} (${{ matrix.pyenv }})
runs-on: ubuntu-latest
strategy:
matrix:
docker-tag: ['stretch-2018-03-13', 'buster-2021-03-25']
pyenv: ['virtualenv', 'system']
fail-fast: false
services:
rpios:
Expand Down Expand Up @@ -129,21 +130,38 @@ jobs:
port: ${{ job.services.rpios.ports[5022] }}
# Purposely skip apt update, install version from image stale index
script: sudo apt-get install -y python3-virtualenv
- name: Create venv and install Python dependencies
- name: Create virtual environment and always activate it
if: matrix.pyenv == 'virtualenv'
uses: appleboy/ssh-action@master
with:
host: rpios
username: pi
password: raspberry
port: ${{ job.services.rpios.ports[5022] }}
command_timeout: 20m
script: |
python3 -m virtualenv ~/mu/.venv -v --python=python3 --system-site-packages
echo "source ~/mu/.venv/bin/activate" > ~/.bashrc_new && cat ~/.bashrc >> ~/.bashrc_new
rm ~/.bashrc && mv ~/.bashrc_new ~/.bashrc
source .venv/bin/activate
python -m pip list
python -m pip install ."[dev]"
- name: Upgrade pip in Stretch system test
if: matrix.pyenv == 'system' && matrix.docker-tag == 'stretch-2018-03-13'
uses: appleboy/ssh-action@master
with:
host: rpios
username: pi
password: raspberry
port: ${{ job.services.rpios.ports[5022] }}
script: python3 -m pip install pip==20.3.4
- name: Install Python dependencies
uses: appleboy/ssh-action@master
with:
host: rpios
username: pi
password: raspberry
port: ${{ job.services.rpios.ports[5022] }}
command_timeout: 20m
script: |
python3 -m pip list
python3 -m pip install ."[dev]"
- name: Environment info
uses: appleboy/ssh-action@master
with:
Expand All @@ -165,4 +183,4 @@ jobs:
password: raspberry
port: ${{ job.services.rpios.ports[5022] }}
command_timeout: 25m
script: xvfb-run python make.py check
script: xvfb-run python3 make.py check
2 changes: 2 additions & 0 deletions make.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,14 @@ def coverage():
"""
print("\ncoverage")
os.environ["LANG"] = "en_GB.utf8"
os.environ["MU_LOG_TO_STDOUT"] = "1"
return subprocess.run(
[
sys.executable,
"-m",
PYTEST,
"-v",
"-s",
"--cov-config",
".coveragerc",
"--cov-report",
Expand Down
2 changes: 1 addition & 1 deletion mu/virtual_environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ def install(self, packages, slots=Process.Slots(), **kwargs):
"""
if isinstance(packages, str):
return self.run(
"install", packages, wait_for_s=180.0, slots=slots, **kwargs
"install", packages, wait_for_s=1360.0, slots=slots, **kwargs
)
else:
return self.run(
Expand Down

0 comments on commit 02ff486

Please sign in to comment.