Use venv on Alpine Linux #23
Workflow file for this run
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
name: test-alpine | |
on: [push, pull_request, workflow_dispatch] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
container: | |
image: alpine:latest | |
defaults: | |
run: | |
shell: sh -exo pipefail {0} | |
steps: | |
- name: Install Alpine Linux packages | |
run: | | |
apk add git git-daemon python3 py3-pip | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Special configuration for Alpine Linux git | |
run: | | |
git config --global --add safe.directory "$(pwd)" | |
- name: Prepare this repo for tests | |
run: | | |
./init-tests-after-clone.sh | |
- name: Set git user identity and command aliases for the tests | |
run: | | |
git config --global user.email "travis@ci.com" | |
git config --global user.name "Travis Runner" | |
# If we rewrite the user's config by accident, we will mess it up | |
# and cause subsequent tests to fail | |
cat test/fixtures/.gitconfig >> ~/.gitconfig | |
- name: Create Python virtual environment | |
run: | | |
python -m venv .venv | |
- name: Update PyPA packages | |
run: | | |
# Get the latest pip, wheel, and prior to Python 3.12, setuptools. | |
. .venv/bin/activate | |
python -m pip install -U pip $(pip freeze --all | grep -ow ^setuptools) wheel | |
- name: Install project and test dependencies | |
run: | | |
. .venv/bin/activate | |
pip install ".[test]" | |
- name: Show version and platform information | |
run: | | |
. .venv/bin/activate | |
uname -a | |
command -v git python | |
git version | |
python --version | |
python -c 'import os, sys; print(f"sys.platform={sys.platform!r}, os.name={os.name!r}")' | |
- name: Test with pytest | |
run: | | |
. .venv/bin/activate | |
pytest --color=yes -p no:sugar --instafail -vv |