-
-
Notifications
You must be signed in to change notification settings - Fork 910
73 lines (59 loc) · 2 KB
/
alpine-test.yml
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
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: Debug ownership
run: |
printenv GITHUB_WORKSPACE
printenv RUNNER_WORKSPACE
whoami
id
ls -alR /__w
- 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 "[email protected]"
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: 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