Merge pull request #7710 from tk0miya/github_actions

Do test with Windows on GitHub Actions
This commit is contained in:
Takeshi KOMIYA
2020-05-30 13:40:17 +09:00
committed by GitHub
2 changed files with 21 additions and 56 deletions

View File

@@ -1,56 +0,0 @@
environment:
global:
TEST: -v --durations 25
PYTHONFAULTHANDLER: x
PYTHONWARNINGS: all
matrix:
- PYTHON: 37
- PYTHON: 37-x64
install:
- C:\Python%PYTHON%\python.exe -m pip install -U pip setuptools
- C:\Python%PYTHON%\python.exe -m pip install .[test,websupport]
cache:
- '%LOCALAPPDATA%\pip\Cache'
# No automatic build, just run python tests
build: off
# Update build information before testing, no warnings during this step
before_test:
- ps: |
$py_warnings = $env:PYTHONWARNINGS
$env:PYTHONWARNINGS = 'ignore'
Update-AppveyorBuild -Version ((& "C:\Python$($env:PYTHON)\python.exe" -m sphinx --version).Split(' ')[2])
$env:PYTHONWARNINGS = $py_warnings
test_script:
- ps: |
Push-Location tests
$test_ignore = $env:TEST_IGNORE
if (-not $test_ignore) { $test_ignore = '' }
$tests = $env:TEST
if (-not $tests) { $tests = '' }
& "C:\Python$($env:PYTHON)\python.exe" -m pytest $test_ignore.Split(' ') --junitxml .junit.xml $tests.Split(' ')
Pop-Location
if ($LastExitCode -eq 1) { Write-Host "Test Failures Occurred, leaving for test result parsing"; exit $LastExitCode }
elseif ($LastExitCode -ne 0) { Write-Host "Other Error Occurred, aborting"; exit $LastExitCode }
after_test:
- ps: (New-Object System.Net.WebClient).UploadFile("https://ci.appveyor.com/api/testresults/junit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path (Join-Path tests .junit.xml)))
after_build:
# Remove old or huge cache files to hopefully not exceed the 1GB cache limit.
#
# If the cache limit is reached, the cache will not be updated (of not even
# created in the first run). So this is a trade of between keeping the cache
# current and having a cache at all.
# NB: This is done only `on_success` since the cache in uploaded only on
# success anyway.
- C:\cygwin\bin\find "%LOCALAPPDATA%\pip" -type f -mtime +360 -delete
- C:\cygwin\bin\find "%LOCALAPPDATA%\pip" -type f -size +10M -delete
- C:\cygwin\bin\find "%LOCALAPPDATA%\pip" -empty -delete
# Show size of cache
- C:\cygwin\bin\du -hs "%LOCALAPPDATA%\pip\Cache"

21
.github/workflows/main.yml vendored Normal file
View File

@@ -0,0 +1,21 @@
name: CI on Windows
on: [push, pull_request]
jobs:
build:
runs-on: windows-latest
strategy:
matrix:
architecture: [x86, x64]
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v1
with:
architecture: ${{ matrix.architecture }}
- name: Install dependencies
run: pip install -U tox
- name: Run Tox
run: tox -e py