Debian Codegraph @

.github/workflows/test_tox.yml

raw
1 # Run tox tests on Ubuntu Docker images using GIFT PPA
2 name: test_tox
3 on:
4 pull_request:
5 branches:
6 - main
7 push:
8 branches:
9 - main
10 permissions: read-all
11 jobs:
12 build:
13 runs-on: ubuntu-latest
14 strategy:
15 matrix:
16 include:
17 - python-version: '3.7'
18 toxenv: 'py37'
19 - python-version: '3.8'
20 toxenv: 'py38'
21 - python-version: '3.9'
22 toxenv: 'py39'
23 - python-version: '3.10'
24 toxenv: 'py310'
25 - python-version: '3.11'
26 toxenv: 'py311'
27 container:
28 image: ubuntu:22.04
29 steps:
30 - uses: actions/checkout@v3
31 - name: Set up container
32 env:
33 DEBIAN_FRONTEND: noninteractive
34 run: |
35 apt-get update -q
36 apt-get install -y libterm-readline-gnu-perl locales software-properties-common
37 locale-gen en_US.UTF-8
38 ln -f -s /usr/share/zoneinfo/UTC /etc/localtime
39 - name: Install dependencies
40 env:
41 DEBIAN_FRONTEND: noninteractive
42 run: |
43 add-apt-repository -y universe
44 add-apt-repository -y ppa:deadsnakes/ppa
45 add-apt-repository -y ppa:gift/dev
46 apt-get update -q
47 apt-get install -y build-essential git libffi-dev python${{ matrix.python-version }} python${{ matrix.python-version }}-dev python${{ matrix.python-version }}-venv python3-distutils python3-pip python3-setuptools python3-yaml
48 - name: Install tox
49 run: |
50 python3 -m pip install tox
51 - name: Run tests
52 env:
53 LANG: en_US.UTF-8
54 run: |
55 tox -e${{ matrix.toxenv }}
56 coverage:
57 runs-on: ubuntu-latest
58 strategy:
59 matrix:
60 include:
61 - python-version: '3.11'
62 toxenv: 'py311,coverage'
63 container:
64 image: ubuntu:22.04
65 steps:
66 - uses: actions/checkout@v3
67 - name: Set up container
68 env:
69 DEBIAN_FRONTEND: noninteractive
70 run: |
71 apt-get update -q
72 apt-get install -y libterm-readline-gnu-perl locales software-properties-common
73 locale-gen en_US.UTF-8
74 ln -f -s /usr/share/zoneinfo/UTC /etc/localtime
75 - name: Install dependencies
76 env:
77 DEBIAN_FRONTEND: noninteractive
78 run: |
79 add-apt-repository -y universe
80 add-apt-repository -y ppa:deadsnakes/ppa
81 add-apt-repository -y ppa:gift/dev
82 apt-get update -q
83 apt-get install -y build-essential git libffi-dev python${{ matrix.python-version }} python${{ matrix.python-version }}-dev python${{ matrix.python-version }}-venv python3-distutils python3-pip python3-setuptools python3-yaml
84 - name: Install tox
85 run: |
86 python3 -m pip install tox
87 - name: Run tests with coverage
88 env:
89 LANG: en_US.UTF-8
90 run: |
91 tox -e${{ matrix.toxenv }}
92 - name: Upload coverage report to Codecov
93 uses: codecov/codecov-action@v3
94 lint:
95 runs-on: ubuntu-latest
96 strategy:
97 matrix:
98 include:
99 - python-version: '3.11'
100 toxenv: 'lint'
101 container:
102 image: ubuntu:22.04
103 steps:
104 - uses: actions/checkout@v3
105 - name: Set up container
106 env:
107 DEBIAN_FRONTEND: noninteractive
108 run: |
109 apt-get update -q
110 apt-get install -y libterm-readline-gnu-perl locales software-properties-common
111 locale-gen en_US.UTF-8
112 ln -f -s /usr/share/zoneinfo/UTC /etc/localtime
113 - name: Install dependencies
114 env:
115 DEBIAN_FRONTEND: noninteractive
116 run: |
117 add-apt-repository -y universe
118 add-apt-repository -y ppa:deadsnakes/ppa
119 add-apt-repository -y ppa:gift/dev
120 apt-get update -q
121 apt-get install -y build-essential git libffi-dev python${{ matrix.python-version }} python${{ matrix.python-version }}-dev python${{ matrix.python-version }}-venv python3-distutils python3-pip python3-setuptools python3-yaml
122 - name: Install tox
123 run: |
124 python3 -m pip install tox
125 - name: Run linter
126 env:
127 LANG: en_US.UTF-8
128 run: |
129 tox -e${{ matrix.toxenv }}