Skip to content

Commit

Permalink
CI
Browse files Browse the repository at this point in the history
  • Loading branch information
pajod committed May 19, 2024
1 parent 2ce4741 commit fd64d9e
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 24 deletions.
54 changes: 41 additions & 13 deletions appveyor.yml → .github/appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,49 +1,77 @@
version: '{branch}.{build}'
image: Visual Studio 2022
branches:
except:
- gh-pages
skip_commits:
files:
- .github/workflows/*
- .github/actions/*
# clone_depth: 1 produces odd "fatal: reference is not a tree" if pushing during checkout
clone_depth: 5
environment:
matrix:
- TOXENV: lint
PYTHON: "C:\\Python38-x64"
- TOXENV: docs-lint
PYTHON: "C:\\Python38-x64"
- TOXENV: pycodestyle
PYTHON: "C:\\Python312-x64"
- TOXENV: pycodestyle
PYTHON: "C:\\Python38-x64"
- TOXENV: WSL
PYTHON: ''
# Windows cannot even import the module when they unconditionally import, see below.
#- TOXENV: run-module
# PYTHON: "C:\\Python38-x64"
#- TOXENV: run-entrypoint
# PYTHON: "C:\\Python38-x64"
# Windows is not ready for testing!!!
# Python's non-blocking pipes, grp, pwd, os.geteuid(), and socket.AF_UNIX are all Unix-only.
#- TOXENV: py35
# PYTHON: "C:\\Python35-x64"
#- TOXENV: py36
# PYTHON: "C:\\Python36-x64"
# Python's fcntl, grp, pwd, os.geteuid(), and socket.AF_UNIX are all Unix-only.
#- TOXENV: py37
# PYTHON: "C:\\Python37-x64"
#- TOXENV: py38
# PYTHON: "C:\\Python38-x64"
#- TOXENV: py39
# PYTHON: "C:\\Python39-x64"
#- TOXENV: py310
# PYTHON: "C:\\Python310-x64"
# PYTHON: "C:\\Python39-x64"
#- TOXENV: py311
# PYTHON: "C:\\Python311-x64"
# PYTHON: "C:\\Python39-x64"
#- TOXENV: py312
# PYTHON: "C:\\Python312-x64"
# PYTHON: "C:\\Python39-x64"
matrix:
allow_failures:
- TOXENV: py35
- TOXENV: py36
- TOXENV: py37
- TOXENV: py38
- TOXENV: py39
init:
- SET "PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%"
install:
- pip install tox
for:
- matrix:
except:
- TOXENV: WSL
install:
- pip install tox
test_script:
- tox
- matrix:
only:
- TOXENV: WSL
# run the wsl -l call last for better error on failure
install:
- wsl pwd
- wsl whoami
- wsl.exe -l || ver>nul
- wsl cat /etc/os-release
- wsl sudo DEBIAN_FRONTEND=noninteractive apt-get update
- wsl sudo DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y python3-venv python3-pip
- wsl python3 -m venv .
- wsl bin/pip install -U pip tox
test_script:
- wsl bin/tox
build: false
test_script:
- tox
cache:
# Not including the .tox directory since it takes longer to download/extract
# the cache archive than for tox to clean install from the pip cache.
Expand Down
40 changes: 31 additions & 9 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,36 +1,58 @@
name: lint
on: [push, pull_request]
on:
push:
paths-ignore:
- .github/appveyor.yml
# tags:
# - '*'
pull_request:
# on pull, automatic
workflow_dispatch:
# allow manual trigger
permissions:
contents: read # to fetch code (actions/checkout)
env:
# note that some tools care only for the name, not the value
FORCE_COLOR: 1
jobs:
lint:
name: tox-${{ matrix.toxenv }}
runs-on: ubuntu-latest
name: ${{ matrix.toxenv }} / ${{ matrix.os }} / ${{ matrix.python-version }}
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idti
meout-minutes
timeout-minutes: 4
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
toxenv: [lint, docs-lint, pycodestyle, format, mypy]
python-version: [ "3.10" ]
include:
- os: ubuntu-latest
python-version: "3.12"
toxenv: null
- os: windows-latest
python-version: "3.12"
toxenv: format
- os: macos-latest
python-version: "3.12"
toxenv: docs-lint
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Using Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0
with:
python-version: ${{ matrix.python-version }}
cache: pip
- name: Install Dependencies
cache-dependency-path: pyproject.toml
- name: "Install Dependencies (cache hit: ${{ steps.setup-python.outputs.cache-hit }})"
if: ${{ matrix.toxenv }}
run: |
python -m pip install --upgrade pip
python -m pip install tox
- run: tox -e ${{ matrix.toxenv }}
if: ${{ matrix.toxenv }}
- name: "Lint support files"
if: ${{ ! matrix.toxenv }}
# github UI shows a green checkmark instead of the original outcome :(
# should probably be called "force-conclusion: success"
continue-on-error: true
env:
# annoying results for pl_PL and fr_FR.. still the only *obvious* choice
LC_ALL: C
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/tox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
python-version: "3.7"
mindep: true
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
- name: Using Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
Expand All @@ -57,13 +57,15 @@ jobs:
cache-dependency-path: pyproject.toml
check-latest: true
allow-prereleases: ${{ matrix.unsupported || false }}
- name: Install Dependencies
- name: "Install test Dependencies (cache hit: ${{ steps.setup-python.outputs.cache-hit }})"
run: |
python -m pip install --upgrade pip
python -m pip install tox
- run: tox -e run-module
timeout-minutes: 2
continue-on-error: ${{ matrix.unsupported || false }}
- run: tox -e run-entrypoint
timeout-minutes: 2
continue-on-error: ${{ matrix.unsupported || false }}
- run: tox -e py
continue-on-error: ${{ matrix.unsupported || false }}
Expand Down

0 comments on commit fd64d9e

Please sign in to comment.