Skip to content

Commit 57e09d6

Browse files
committed
fix(.github/workflows/main.yml): set env at runtime
1 parent 03ca963 commit 57e09d6

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

.github/workflows/main.yml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,12 @@ jobs:
5151
python -m pip install --upgrade pip
5252
pip install tox
5353
- name: Run tests
54-
env:
55-
TZ: ${{ matrix.timezone || 'UTC' }}
5654
run: |
57-
echo "Running tests with timezone: $TZ"
58-
date
59-
python -c "import datetime; print(f'Python datetime now: {datetime.datetime.now()}')"
60-
python -c "import time; print(f'Python time localtime: {time.localtime()}')"
61-
tox -e ${{ matrix.toxenv || 'py' }}
55+
TZ=${{ matrix.timezone || 'UTC' }} echo "Running tests with timezone: $TZ"
56+
TZ=${{ matrix.timezone || 'UTC' }} date
57+
TZ=${{ matrix.timezone || 'UTC' }} python -c "import datetime; print(f'Python datetime now: {datetime.datetime.now()}')"
58+
TZ=${{ matrix.timezone || 'UTC' }} python -c "import time; print(f'Python time localtime: {time.localtime()}')"
59+
TZ=${{ matrix.timezone || 'UTC' }} tox -e ${{ matrix.toxenv || 'py' }}
6260
- name: Upload coverage.xml to codecov
6361
uses: codecov/codecov-action@v5
6462
with:

tox.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ deps =
1313
atheris; python_version < '3.12'
1414
commands =
1515
pytest --cov=dateparser --cov-report=xml {posargs: tests}
16+
passenv = TZ
1617

1718
[testenv:all]
1819
basepython = python3.13

0 commit comments

Comments
 (0)