forked from falconry/falcon
-
Notifications
You must be signed in to change notification settings - Fork 0
83 lines (75 loc) · 2.43 KB
/
tests-emulated.yaml
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
name: Run tests (emulated)
on:
# Trigger the workflow on master but also allow it to run manually.
workflow_dispatch:
push:
branches:
- master
jobs:
run_tox_emulate:
name: tox -e py310_cython (${{ matrix.architecture }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
architecture:
- s390x
- arm64v8
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Cache PIP
uses: actions/cache@v3
with:
path: |
.pip
key: python-${{ matrix.architecture }}-${{ hashFiles('requirements/tests') }}
- name: Set up emulation
run: |
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
# TODO(vytas): Revisit second half of 2021 to see if we still need to pin tox
#
# See also: https://github.com/tox-dev/tox/issues/1777
#
- name: Run tox s390x
if: ${{ matrix.architecture == 's390x' }}
uses: docker://s390x/python:3.10-buster
env:
PIP_CACHE_DIR: /github/workspace/.pip/
with:
# NOTE: without 'pip install ujson' tox fails to install it with "Requested ujson from <url> has different version in metadata: '0.0.0'"
# NOTE(vytas): installing fixtures/pbr because otherwise pip install
# inside tox fails with an import error on some older CPythons
args: |
/bin/bash -c "
lscpu &&
mkdir -p $PIP_CACHE_DIR &&
chown -R $(whoami) $PIP_CACHE_DIR &&
pip install -U fixtures pip tox &&
python --version &&
pip --version &&
tox --version &&
pip install ujson &&
tox -e py310_cython"
- name: Run tox arm64v8
if: ${{ matrix.architecture == 'arm64v8' }}
uses: docker://arm64v8/python:3.10-buster
env:
PIP_CACHE_DIR: /github/workspace/.pip/
with:
args: |
/bin/bash -c "
lscpu &&
mkdir -p $PIP_CACHE_DIR &&
chown -R $(whoami) $PIP_CACHE_DIR &&
pip install -U fixtures pip tox &&
python --version &&
pip --version &&
tox --version &&
tox -e py310_cython"
- name: Fix cache permission
run: |
sudo chmod -R 777 .pip
sudo chmod -R 777 .tox