Skip to content

port fix env

port fix env #154

Workflow file for this run

name: Lint
on: [push, pull_request]
permissions:
contents: read # for dorny/paths-filter to fetch a list of changed files
pull-requests: read # for dorny/paths-filter to read pull requests
jobs:
Salt:
name: Lint Salt's Source Code
runs-on: ${{ github.event.repository.private && fromJSON('["self-hosted", "linux", "medium", "x86_64"]') || 'ubuntu-latest' }}
container:
image: ghcr.io/saltstack/salt-ci-containers/python:3.8
steps:
- name: Install System Deps
run: |
apt-get update
apt-get upgrade debian-keyring -y
echo "deb http://deb.debian.org/debian bookworm-backports main" >> /etc/apt/sources.list
apt-get update
apt-get install -y enchant-2 git gcc make zlib1g-dev libc-dev libffi-dev g++ libxml2 libxml2-dev libxslt-dev libcurl4-openssl-dev libssl-dev libgnutls28-dev
- uses: actions/checkout@v3
- name: Add Git Safe Directory
run: |
git config --global --add safe.directory $(pwd)
- 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
- id: changed-files
name: Get Changed Files
uses: dorny/paths-filter@v2
with:
token: ${{ github.token }}
list-files: json
filters: |
salt:
- added|modified:
- setup.py
- noxfile.py
- salt/**/*.py
- tasks/**/*.py
rcfile:
- added|modified:
- .pylintrc
- name: Install Python Requirements
env:
PIP_EXTRA_INDEX_URL: https://pypi-proxy.saltstack.net/root/local/+simple/
run:
nox --install-only --forcecolor -e lint-salt
- name: Lint Changed Files
if: github.event_name == 'pull_request' && steps.changed-files.outputs.salt == 'true'
env:
SKIP_REQUIREMENTS_INSTALL: YES
run: |
nox --forcecolor -e lint-salt -- ${{ join(fromJSON(steps.changed-files.outputs.salt_files), ' ') }}
- name: Lint ALL Files
if: steps.changed-files.outputs.salt == 'true' || steps.changed-files.outputs.rcfile == 'true'
env:
SKIP_REQUIREMENTS_INSTALL: YES
run: |
nox --forcecolor -e lint-salt
Tests:
name: Lint Salt's Test Suite
runs-on: ${{ github.event.repository.private && fromJSON('["self-hosted", "linux", "medium", "x86_64"]') || 'ubuntu-latest' }}
container:
image: ghcr.io/saltstack/salt-ci-containers/python:3.8
steps:
- name: Install System Deps
run: |
apt-get update
apt-get upgrade debian-keyring -y
echo "deb http://deb.debian.org/debian bookworm-backports main" >> /etc/apt/sources.list
apt-get update
apt-get install -y enchant-2 git gcc make zlib1g-dev libc-dev libffi-dev g++ libxml2 libxml2-dev libxslt-dev libcurl4-openssl-dev libssl-dev libgnutls28-dev
- uses: actions/checkout@v3
- name: Add Git Safe Directory
run: |
git config --global --add safe.directory $(pwd)
- name: Install Nox
env:
PIP_EXTRA_INDEX_URL: https://pypi-proxy.saltstack.net/root/local/+simple/
run: |
git config --global --add safe.directory $(pwd)
python -m pip install --upgrade pip
pip install nox
- id: changed-files
name: Get Changed Files
uses: dorny/paths-filter@v2
with:
token: ${{ github.token }}
list-files: json
filters: |
tests:
- added|modified:
- tests/**/*.py
rcfile:
- added|modified:
- .pylintrc
- name: Install Python Requirements
env:
PIP_EXTRA_INDEX_URL: https://pypi-proxy.saltstack.net/root/local/+simple/
run:
nox --install-only --forcecolor -e lint-tests
- name: Lint Changed Files
if: github.event_name == 'pull_request' && steps.changed-files.outputs.tests == 'true'
env:
SKIP_REQUIREMENTS_INSTALL: YES
run: |
nox --forcecolor -e lint-tests -- ${{ join(fromJSON(steps.changed-files.outputs.tests_files), ' ') }}
- name: Lint ALL Files
if: steps.changed-files.outputs.tests == 'true' || steps.changed-files.outputs.rcfile == 'true'
env:
SKIP_REQUIREMENTS_INSTALL: YES
run: |
nox --forcecolor -e lint-tests