-
-
Notifications
You must be signed in to change notification settings - Fork 1
139 lines (119 loc) · 4.68 KB
/
Copy pathtests.yml
File metadata and controls
139 lines (119 loc) · 4.68 KB
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
name: Run Tests
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
workflow_dispatch:
permissions:
contents: read
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
python_version: ['3.11', '3.12', '3.13', '3.14']
os: [ubuntu-latest, macOS-latest] # TODO: windows-latest
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python_version }}
- name: Install uv
uses: astral-sh/setup-uv@v3
with:
enable-cache: true
cache-dependency-glob: "uv.lock"
- name: Install Nix on macOS
if: runner.os == 'macOS'
uses: DeterminateSystems/nix-installer-action@v16
- name: Setup venv and install pip dependencies
run: |
uv venv --python "${{ matrix.python_version }}" \
&& uv sync --all-extras \
&& uv pip install pip \
&& echo "/home/linuxbrew/.linuxbrew/bin" >> "$GITHUB_PATH" \
&& if [ -d /nix/var/nix/profiles/default/bin ]; then echo "/nix/var/nix/profiles/default/bin" >> "$GITHUB_PATH"; fi
- name: Run standard test suite
run: |
source .venv/bin/activate \
&& python tests.py
live-integration:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: [ubuntu-latest, macos-15-intel]
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install uv
uses: astral-sh/setup-uv@v3
with:
enable-cache: true
cache-dependency-glob: "uv.lock"
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@v16
- name: Setup Docker on macOS
if: runner.os == 'macOS'
uses: docker/setup-docker-action@v4
env:
LIMA_START_ARGS: --vm-type=vz
with:
daemon-config: |
{
"debug": true
}
- name: Setup venv and install pip dependencies
run: |
uv venv --python "3.12" \
&& uv sync --all-extras \
&& uv pip install pip \
&& echo "/home/linuxbrew/.linuxbrew/bin" >> "$GITHUB_PATH" \
&& echo "/nix/var/nix/profiles/default/bin" >> "$GITHUB_PATH"
- name: Inspect Docker on macOS
if: runner.os == 'macOS'
run: |
docker version \
&& docker info
- name: Run non-root live package lifecycle tests on macOS
if: runner.os == 'macOS'
env:
ABX_PKG_LIVE_PKG_TESTS: "1"
run: |
source .venv/bin/activate \
&& python -m unittest \
tests.LiveUpdateAndUninstallTest.test_brew_provider_live_update_and_uninstall \
tests.LiveUpdateAndUninstallTest.test_pip_provider_live_update_and_uninstall \
tests.LiveUpdateAndUninstallTest.test_npm_provider_live_update_and_uninstall \
tests.LiveUpdateAndUninstallTest.test_cargo_provider_live_update_and_uninstall \
tests.LiveUpdateAndUninstallTest.test_gem_provider_live_update_and_uninstall \
tests.LiveUpdateAndUninstallTest.test_go_get_provider_live_update_and_uninstall \
tests.LiveUpdateAndUninstallTest.test_nix_provider_live_update_and_uninstall \
tests.LiveUpdateAndUninstallTest.test_docker_provider_live_update_and_uninstall
- name: Run non-root live package lifecycle tests on Linux
if: runner.os == 'Linux'
env:
ABX_PKG_LIVE_PKG_TESTS: "1"
run: |
source .venv/bin/activate \
&& python -m unittest \
tests.LiveUpdateAndUninstallTest.test_pip_provider_live_update_and_uninstall \
tests.LiveUpdateAndUninstallTest.test_npm_provider_live_update_and_uninstall \
tests.LiveUpdateAndUninstallTest.test_cargo_provider_live_update_and_uninstall \
tests.LiveUpdateAndUninstallTest.test_gem_provider_live_update_and_uninstall \
tests.LiveUpdateAndUninstallTest.test_go_get_provider_live_update_and_uninstall \
tests.LiveUpdateAndUninstallTest.test_nix_provider_live_update_and_uninstall \
tests.LiveUpdateAndUninstallTest.test_docker_provider_live_update_and_uninstall
- name: Run root-required live package lifecycle tests on Linux
if: runner.os == 'Linux'
run: |
sudo env "PATH=$PATH:/nix/var/nix/profiles/default/bin" "ABX_PKG_LIVE_PKG_TESTS=1" ./.venv/bin/python -m unittest \
tests.LiveUpdateAndUninstallTest.test_apt_provider_live_update_and_uninstall \
tests.LiveUpdateAndUninstallTest.test_pyinfra_provider_live_update_and_uninstall \
tests.LiveUpdateAndUninstallTest.test_ansible_provider_live_update_and_uninstall