Skip to content

Commit

Permalink
Fixed color output when running GitHub Actions (#335)
Browse files Browse the repository at this point in the history
Was broken by move to `tox`.
  • Loading branch information
freemanjp authored Aug 3, 2023
1 parent c3564f5 commit 85df04c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ on:

env:
PY_COLORS: '1'
ANSIBLE_FORCE_COLOR: '1'

jobs:
lint:
Expand Down Expand Up @@ -44,7 +43,7 @@ jobs:
run: pip3 install --no-compile -r requirements/tox.txt

- name: Lint
run: tox run -e lint
run: tox --colored=yes run -e lint

- name: Compact lint cache
if: steps.lint-cache.outputs.cache-hit != 'true'
Expand Down Expand Up @@ -131,7 +130,7 @@ jobs:
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Molecule test
run: tox run -e ansible-${{ matrix.ansible-version }} -- --scenario-name=${{ matrix.molecule-scenario }}
run: tox --colored=yes run -e ansible-${{ matrix.ansible-version }} -- --scenario-name=${{ matrix.molecule-scenario }}

- name: Compact Molecule cache
if: steps.molecule-cache.outputs.cache-hit != 'true'
Expand Down
6 changes: 6 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ deps =
ansible-max: -r requirements/ansible-max.txt
commands =
molecule test {posargs}
setenv =
PY_COLORS = 1
ANSIBLE_FORCE_COLOR = 1

[testenv:lint]
description = runs lint checks on the role
Expand All @@ -23,6 +26,9 @@ commands =
yamllint .
ansible-lint .
flake8 --exclude .tox,.venv
setenv =
PY_COLORS = 1
ANSIBLE_FORCE_COLOR = 1

[testenv:dev]
description = dependencies for development
Expand Down

0 comments on commit 85df04c

Please sign in to comment.