-
Notifications
You must be signed in to change notification settings - Fork 18
51 lines (49 loc) · 1.37 KB
/
ci.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
name: CI
on:
push:
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
tox:
strategy:
fail-fast: false
matrix:
python-version: ["3.11", "3.x"]
upstream: ["upstream", "pypi"]
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Detect skipped environments
id: skipenv
env:
UPSTREAM: ${{ matrix.upstream }}
run: |
set -ex
case $UPSTREAM in
upstream)
echo 'skipenv=.*(?<!upstream)$' >> $GITHUB_OUTPUT
;;
*)
echo 'skipenv=.*-upstream$' >> $GITHUB_OUTPUT
;;
esac
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
sudo apt-get update
# Install dependencies for python-ldap
sudo apt-get install -y libsasl2-dev python3-dev libldap2-dev libssl-dev
python -m pip install --upgrade pip
pip install tox tox-gh
- name: Prepare tox environment and install packages
run: |
tox --skip-env '${{ steps.skipenv.outputs.skipenv }}' --colored=yes --notest
- name: Run tests
run: |
tox --skip-env '${{ steps.skipenv.outputs.skipenv }}' --colored=yes --skip-pkg-install