forked from performancecopilot/ansible-pcp
-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (48 loc) · 1.62 KB
/
tox.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
# yamllint disable rule:line-length
name: tox
on: # yamllint disable-line rule:truthy
- pull_request
- push
env:
TOX_LSR: "git+https://github.com/linux-system-roles/[email protected]"
LSR_ROLE2COLL_NAMESPACE: "performancecopilot"
LSR_ROLE2COLL_NAME: "metrics"
LSR_ANSIBLE_TEST_DOCKER: "true"
LSR_ANSIBLES: 'ansible==2.9.*'
LSR_MSCENARIOS: default
# LSR_EXTRA_PACKAGES: libdbus-1-dev
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
python:
runs-on: ubuntu-latest
strategy:
matrix:
pyver: ['2.7', '3.6', '3.7', '3.8', '3.9']
steps:
- name: checkout PR
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.pyver }}
- name: Install platform dependencies, python, tox, tox-lsr
run: |
set -euxo pipefail
python -m pip install --upgrade pip
sudo apt-get update
sudo apt-get -y install git
pip install "$TOX_LSR"
lsr_ci_preinstall
- name: Run tox tests
run: |
set -euxo pipefail
toxpyver=$(echo "${{ matrix.pyver }}" | tr -d .)
toxenvs="py${toxpyver}"
case "$toxpyver" in
27) toxenvs="${toxenvs},coveralls,flake8,pylint" ;;
36) toxenvs="${toxenvs},coveralls,black,yamllint,shellcheck" ;;
37) toxenvs="${toxenvs},coveralls" ;;
38) toxenvs="${toxenvs},coveralls,ansible-lint,ansible-plugin-scan,collection,ansible-test" ;;
39) toxenvs="${toxenvs},coveralls,ansible-managed-var-comment" ;;
esac
TOXENV="$toxenvs" lsr_ci_runtox