The whole CI process is already slower than GH Actions, no caches.

This commit is contained in:
Pedro Algarvio 2021-06-26 08:35:17 +01:00 committed by Megan Wilhite
parent 15f2c879b7
commit fb0a971730
4 changed files with 31 additions and 75 deletions

View file

@ -21,11 +21,9 @@ jobs:
- uses: actions/checkout@v2
- name: Set Python Version Env Var
run: |
echo PY_VERSION=$(python -c 'import sys; print("{}.{}".format(*sys.version_info))') >> $GITHUB_ENV
- name: Install Nox
env:
PIP_EXTRA_INDEX_URL: https://pypi-proxy.saltstack.net/root/local/+simple/
run: |
python -m pip install --upgrade pip
pip install nox
@ -40,15 +38,6 @@ jobs:
docs:
- doc/**
- name: Set Docs Python Cache Key
run: echo "PY=$(python --version --version | sha256sum | cut -d' ' -f1)" >> $GITHUB_ENV
- name: Setup Nox Cache
uses: pat-s/always-upload-cache@v2.1.3
with:
path: .nox/
key: docs-salt|${{ env.PY }}|${{ hashFiles(format('requirements/static/ci/py{0}/*.txt', env.PY_VERSION)) }}
- name: Install Python Requirements
env:
PIP_EXTRA_INDEX_URL: https://pypi-proxy.saltstack.net/root/local/+simple/
@ -95,28 +84,14 @@ jobs:
docs:
- doc/**
- name: Set Python Version Env Var
if: github.event_name == 'push' || steps.changed-files.outputs.docs == 'true'
run: |
echo PY_VERSION=$(python -c 'import sys; print("{}.{}".format(*sys.version_info))') >> $GITHUB_ENV
- name: Install Nox
if: github.event_name == 'push' || steps.changed-files.outputs.docs == 'true'
env:
PIP_EXTRA_INDEX_URL: https://pypi-proxy.saltstack.net/root/local/+simple/
run: |
python -m pip install --upgrade pip
pip install nox
- name: Set Docs Python Cache Key
if: github.event_name == 'push' || steps.changed-files.outputs.docs == 'true'
run: echo "PY=$(python --version --version | sha256sum | cut -d' ' -f1)" >> $GITHUB_ENV
- name: Setup Nox Cache
if: github.event_name == 'push' || steps.changed-files.outputs.docs == 'true'
uses: pat-s/always-upload-cache@v2.1.3
with:
path: .nox/
key: docs-man|${{ env.PY }}|${{ hashFiles(format('requirements/static/ci/py{0}/*.txt', env.PY_VERSION)) }}
- name: Install Python Requirements
if: github.event_name == 'push' || steps.changed-files.outputs.docs == 'true'
env:

View file

@ -21,24 +21,13 @@ jobs:
- uses: actions/checkout@v2
- name: Set Python Version Env Var
run: |
echo PY_VERSION=$(python -c 'import sys; print("{}.{}".format(*sys.version_info))') >> $GITHUB_ENV
- name: Install Nox
env:
PIP_EXTRA_INDEX_URL: https://pypi-proxy.saltstack.net/root/local/+simple/
run: |
python -m pip install --upgrade pip
pip install nox
- name: Set Lint Python Cache Key
run: echo "PY=$(python --version --version | sha256sum | cut -d' ' -f1)" >> $GITHUB_ENV
- name: Setup Nox Cache
uses: pat-s/always-upload-cache@v2.1.3
with:
path: .nox/
key: lint-salt|${{ env.PY }}|${{ hashFiles(format('requirements/static/ci/py{0}/*.txt', env.PY_VERSION)) }}
- id: changed-files
name: Get Changed Files
uses: dorny/paths-filter@v2
@ -91,24 +80,13 @@ jobs:
- uses: actions/checkout@v2
- name: Set Python Version Env Var
run: |
echo PY_VERSION=$(python -c 'import sys; print("{}.{}".format(*sys.version_info))') >> $GITHUB_ENV
- name: Install Nox
env:
PIP_EXTRA_INDEX_URL: https://pypi-proxy.saltstack.net/root/local/+simple/
run: |
python -m pip install --upgrade pip
pip install nox
- name: Set Lint Python Cache Key
run: echo "PY=$(python --version --version | sha256sum | cut -d' ' -f1)" >> $GITHUB_ENV
- name: Setup Nox Cache
uses: pat-s/always-upload-cache@v2.1.3
with:
path: .nox/
key: lint-tests|${{ env.PY }}|${{ hashFiles(format('requirements/static/ci/py{0}/*.txt', env.PY_VERSION)) }}
- id: changed-files
name: Get Changed Files
uses: dorny/paths-filter@v2

View file

@ -22,14 +22,13 @@ jobs:
- uses: actions/checkout@v2
- name: Set Pre-Commit Cache Key
run: echo "PY=$(python --version --version | sha256sum | cut -d' ' -f1)" >> $GITHUB_ENV
- name: Setup Pre-Commit Cache
uses: pat-s/always-upload-cache@v2.1.3
with:
path: ~/.cache/pre-commit
key: pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }}
- name: Install Pre-Commit
env:
PIP_EXTRA_INDEX_URL: https://pypi-proxy.saltstack.net/root/local/+simple/
run: |
python -m pip install --upgrade pip
pip install pre-commit
pre-commit install --install-hooks
- id: changed-files
name: Get Changed Files
@ -46,21 +45,24 @@ jobs:
- '**'
- name: Check ALL Files On Branch
uses: pre-commit/action@v2.0.0
if: github.event_name != 'pull_request'
env:
SKIP: lint-salt,lint-tests,pyupgrade,remove-import-headers,rstcheck
PIP_EXTRA_INDEX_URL: https://pypi-proxy.saltstack.net/root/local/+simple/
run: |
pre-commit run --show-diff-on-failure --color=always --all-files
- name: Check Changed Files On PR
uses: pre-commit/action@v2.0.0
if: github.event_name == 'pull_request' && steps.changed-files.outputs.repo == 'true'
with:
extra_args: --files ${{ join(fromJSON(steps.changed-files.outputs.repo_files), ' ') }}
env:
SKIP: lint-salt,lint-tests
PIP_EXTRA_INDEX_URL: https://pypi-proxy.saltstack.net/root/local/+simple/
run: |
pre-commit run --show-diff-on-failure --color=always --files ${{ join(fromJSON(steps.changed-files.outputs.repo_files), ' ') }}
- name: Check Docs On Deleted Files
uses: pre-commit/action@v2.0.0
if: steps.changed-files.outputs.deleted == 'true'
with:
extra_args: check-docs --files ${{ join(fromJSON(steps.changed-files.outputs.deleted_files), ' ') }}
env:
PIP_EXTRA_INDEX_URL: https://pypi-proxy.saltstack.net/root/local/+simple/
run: |
pre-commit run --show-diff-on-failure --color=always check-docs --files ${{ join(fromJSON(steps.changed-files.outputs.deleted_files), ' ') }}

View file

@ -14,17 +14,18 @@ jobs:
uses: actions/setup-python@v2
with:
python-version: '3.8'
- uses: actions/cache@v2
with:
path: ${{ env.pythonLocation }}
key: ${{ env.pythonLocation }}-${{ hashFiles('README.rst') }}-${{ hashFiles('.github/workflows/twine-check.yml') }}
- name: Install dependencies
env:
PIP_EXTRA_INDEX_URL: https://pypi-proxy.saltstack.net/root/local/+simple/
run: |
pip install --upgrade pip setuptools wheel
pip install twine>=3.4.1
- name: Python setup
- name: Create Source Tarball
run: |
python3 setup.py sdist
- name: Twine check
run: |
python3 -m twine check dist/*