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

Appearance settings

Latest commit

 

History

History
History
97 lines (80 loc) · 3 KB

File metadata and controls

97 lines (80 loc) · 3 KB
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
name: test-alpine
on: [push, pull_request, workflow_dispatch]
permissions:
contents: read
jobs:
test:
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 py3-virtualenv
echo 'Defaults env_keep += "CI GITHUB_* RUNNER_*"' >/etc/sudoers.d/ci_env
addgroup -g 127 docker
adduser -D -u 1001 runner # TODO: Check if this still works on GHA as intended.
adduser runner docker
shell: sh -exo pipefail {0} # Run this as root, not the "runner" user.
- uses: actions/checkout@v6
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 virtual environment
run: |
python -m venv .venv
- name: Update PyPA packages
run: |
. .venv/bin/activate
python -m pip install -U pip 'setuptools; python_version<"3.12"' wheel
- name: Install project and test dependencies
run: |
. .venv/bin/activate
pip install '.[test]'
- name: Show POSIX file ownership
run: |
ls -ld -- \
"$(pwd)" \
"$(pwd)/.git" \
"$(pwd)/git/ext/gitdb" \
"$(pwd)/git/ext/gitdb/.git" \
"$(pwd)/git/ext/gitdb/gitdb/ext/smmap" \
"$(pwd)/git/ext/gitdb/gitdb/ext/smmap/.git" \
"${HOME:?HOME is not set}/.gitconfig" \
2>&1 || true
- name: Show safe.directory entries
# `actions/checkout`'s safe.directory add is only durable for the
# checkout itself (it writes under a throwaway HOME override and
# then discards it), so by the time this step runs the runner
# user's `~/.gitconfig` has no entries -- and the Alpine container
# chowns the workspace to runner:docker to match the test user, so
# git accepts the ownership without one. Expected: `(none)`.
run: git config --global --get-all safe.directory || echo "(none)"
- 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
Morty Proxy This is a proxified and sanitized view of the page, visit original site.