Skip to content

build

build #338

Workflow file for this run

name: build
# When the 'permissions' key is specified, unspecified permission scopes (e.g.,
# actions, checks, etc.) are set to no access (none).
permissions:
contents: read
on:
push:
branches: [master]
pull_request:
branches: [master]
schedule:
# Run weekly (* is a special character in YAML, so quote the string)
- cron: '0 0 * * 0'
workflow_dispatch:
inputs:
# When git-ref is empty, HEAD will be checked out.
git-ref:
description: Optional git ref (branch, tag, or full SHA)
required: false
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version: ['3.6', '3.7', '3.8', '3.9', '3.10', '3.11', '3.12']
os: [macos-latest, windows-latest, ubuntu-latest]
exclude:
# Python 3.6 is not supported on GitHub-hosted Ubuntu runners as of Ubuntu 22.04.
# https://github.com/actions/setup-python/issues/544#issuecomment-1332535877
- os: ubuntu-latest
python-version: '3.6'
# Python 3.7 is not supported on GitHub-hosted Ubuntu runners as of Ubuntu 24.04.
- os: ubuntu-latest
python-version: '3.7'
# Python versions prior to 3.8 are not supported on GitHub-hosted macOS runners
# as of macOS 14.
# https://github.com/actions/runner-images/issues/9770
- os: macos-latest
python-version: '3.6'
- os: macos-latest
python-version: '3.7'
steps:
- name: Checkout
uses: actions/checkout@v4
with:
# When the ref is empty, HEAD will be checked out.
ref: ${{ github.event.inputs.git-ref }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Upgrade Pip
run: python -m pip install --upgrade pip
- name: Lint
run: |
pip install flake8
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Install
run: |
pip install .
- name: Test
shell: pwsh
run: |
$ErrorActionPreference = 'Stop'
# First, confirm that numpy is not installed
python -c 'import numpy' 2>$null
if ($LASTEXITCODE -eq 0) { throw 'numpy is installed' }
pastiche `
--num-steps 10 `
--info-step 1 `
--content example/boston.jpg `
--styles example/vangogh_starry_night.jpg `
--output test-example.png