Make sure tox is available #165
This file contains 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: Linux CI | |
env: | |
# NOTE: This version must match between all .yml files in the | |
# .github/workflows directory | |
TOX_VERSION: 4.0.9 | |
on: | |
# Triggers the workflow on push or pull request events but only for the main branch | |
push: | |
branches: [python] | |
pull_request: | |
branches: [python] | |
jobs: | |
shellcheck: | |
name: Shellcheck | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Run ShellCheck | |
uses: ludeeus/action-shellcheck@master | |
tox: | |
runs-on: ubuntu-22.04 | |
env: | |
# This is a regex: | |
# https://github.com/tox-dev/tox/pull/990/files#diff-bfeb43314e311bd2d19d2b1ea565841101c8468f0df8cd3f86b4f199f06c0766 | |
# | |
# We skip shellcheck because we already run it in its own job ^, which | |
# feels simpler than having to install shellcheck manually in here. | |
TOX_SKIP_ENV: shellcheck | |
steps: | |
- name: Check out repository code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # For getting tags from the repo | |
- name: Cache .tox directory | |
uses: actions/cache@v3 | |
with: | |
path: .tox | |
key: ${{ runner.os }}-${{ hashFiles('tox.ini') }} | |
- name: Create a virtualenv | |
run: | | |
python3 -m venv env | |
- name: Install tox in our virtualenv | |
run: | | |
. ./env/bin/activate | |
pip install tox==${{ env.TOX_VERSION }} | |
- name: Run tox in our virtualenv | |
run: | | |
. ./env/bin/activate | |
tox |