Fixed Github workflow deprecation Ubuntu 20.04 #114
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: Tox Test | |
on: | |
push: | |
branches: | |
- '*' | |
workflow_dispatch: | |
defaults: | |
run: | |
working-directory: 'docker' | |
jobs: | |
matrix: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
path: 'docker' | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.11" | |
- name: Install tox-ansible, includes tox | |
run: python3 -m pip install 'tox-ansible>=2.0.0,<2.1.0' | |
- name: Generate matrix | |
id: generate-matrix | |
run: | | |
echo "envlist=$(bash tox-ansible.sh --stdout | jq -c)" >> "$GITHUB_OUTPUT" | |
outputs: | |
envlist: ${{ steps.generate-matrix.outputs.envlist }} | |
test: | |
needs: matrix | |
strategy: | |
fail-fast: false | |
matrix: | |
entry: ${{ fromJson(needs.matrix.outputs.envlist) }} | |
name: ${{ matrix.entry.name }} | |
runs-on: ${{ matrix.entry.run_on }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
path: 'docker' | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.entry.python_version }} | |
env: | |
# https://github.com/actions/setup-python/issues/866 | |
PIP_TRUSTED_HOST: "pypi.python.org pypi.org files.pythonhosted.org" | |
- name: Install dependencies | |
run: | | |
python3 -m pip install 'tox-ansible>=2.0.0,<2.1.0' | |
- name: Test tox | |
run: | | |
if [[ "${{ matrix.entry.conf }}" == "tox-ansible.ini" ]]; then | |
tox --ansible -c ${{ matrix.entry.conf }} -e ${{ matrix.entry.environment }} -v -- -r A | |
else | |
tox -c ${{ matrix.entry.conf }} -e ${{ matrix.entry.environment }} -v | |
fi |