Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Test in Docker with Alpine Linux on CI#1826

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Byron merged 10 commits intogitpython-developers:mainfromEliahKagan:docker
Feb 16, 2024
Merged
Show file tree
Hide file tree
Changes fromall 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
72 changes: 72 additions & 0 deletions.github/workflows/alpine-test.yml
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
name: test-alpine

on: [push, pull_request, workflow_dispatch]

jobs:
build:
runs-on: ubuntu-latest

container:
image: alpine:latest

defaults:
run:
shell: sudo -u runner sh -exo pipefail {0}

steps:
- name: Prepare Alpine Linux
run: |
apk add sudo git git-daemon python3 py3-pip
echo 'Defaults env_keep += "CI GITHUB_* RUNNER_*"' >/etc/sudoers.d/ci_env
addgroup -g 127 docker
adduser -D -u 1001 runner
adduser runner docker
shell: sh -exo pipefail {0} # Run this as root, not the "runner" user.

- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set workspace ownership
run: |
chown -R runner:docker -- "$GITHUB_WORKSPACE"
shell: sh -exo pipefail {0} # Run this as root, not the "runner" user.

- 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: Set up virtualenv
run: |
python -m venv .venv
. .venv/bin/activate
printf '%s=%s\n' 'PATH' "$PATH" 'VIRTUAL_ENV' "$VIRTUAL_ENV" >>"$GITHUB_ENV"

- name: Update PyPA packages
run: |
# Get the latest pip, wheel, and prior to Python 3.12, setuptools.
python -m pip install -U pip $(pip freeze --all | grep -ow ^setuptools) wheel

- name: Install project and test dependencies
run: |
pip install ".[test]"

- name: Show version and platform information
run: |
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: |
pytest --color=yes -p no:sugar --instafail -vv
4 changes: 3 additions & 1 deletiontest/test_util.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -51,7 +51,9 @@ def permission_error_tmpdir(tmp_path):
# Set up PermissionError on Windows, where we can't delete read-only files.
(td / "x").chmod(stat.S_IRUSR)

# Set up PermissionError on Unix, where we can't delete files in read-only directories.
# Set up PermissionError on Unix, where non-root users can't delete files in
# read-only directories. (Tests that rely on this and assert that rmtree raises
# PermissionError will fail if they are run as root.)
td.chmod(stat.S_IRUSR | stat.S_IXUSR)

yield td
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp