Run automated tests #382
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Run automated tests | |
on: | |
push: | |
paths-ignore: | |
- '**.md' | |
- '.git*' | |
pull_request: | |
schedule: | |
- cron: '17 7 9,19,29 * *' | |
jobs: | |
linux: | |
name: linux-py${{ matrix.py }} | |
runs-on: ubuntu-latest | |
container: python:${{ matrix.py }} | |
strategy: | |
matrix: | |
py: | |
- '3.9' | |
- '3.10' | |
- '3.11' | |
- '3.12' | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: CI setup | |
run: |- | |
git config --global --add safe.directory $(pwd) | |
- name: Run functional tests | |
run: make -C tests test-verbose | |
env: | |
TEST_SUBPROCESS_TIMEOUT: 300 | |
- name: Run packaging tests | |
run: make -C pypi test | |
other: | |
name: ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: | |
- windows-latest | |
- macos-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Remove py.exe on Windows | |
run: del /f %WINDIR%\py.exe | |
shell: cmd | |
if: matrix.os == 'windows-latest' | |
- name: Configure Windows environment variables | |
run: | | |
echo "PY=python" >> $GITHUB_ENV | |
echo "TEMP=C:\tmp" >> $GITHUB_ENV # remove when pip>22.0.3 is released | |
mkdir -p "C:\tmp" # see https://github.com/sio/Makefile.venv/issues/17 | |
shell: bash | |
if: matrix.os == 'windows-latest' | |
- name: Run functional tests | |
run: make -C tests test-verbose | |
env: | |
TEST_SUBPROCESS_TIMEOUT: 300 | |
- name: Run packaging tests | |
run: make -C pypi test | |
cygwin: | |
name: windows-cygwin | |
runs-on: windows-latest | |
env: | |
CYGWIN_ROOT: D:\cygwin | |
CYGWIN_PACKAGES: "\ | |
make,\ | |
python3,\ | |
git,\ | |
bash,\ | |
python-pip-wheel,\ | |
python-setuptools-wheel,\ | |
python-wheel-wheel" | |
CYGWIN_MIRROR: http://mirrors.kernel.org/sourceware/cygwin/ | |
LC_ALL: C.UTF-8 | |
LANG: C.UTF-8 | |
SHELLOPTS: igncr | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Install Cygwin | |
run: > | |
md %CYGWIN_ROOT% && | |
choco install cygwin --params='"/InstallDir:%CYGWIN_ROOT%"' && | |
%CYGWIN_ROOT%\cygwinsetup.exe | |
--quiet-mode | |
--no-desktop | |
--download | |
--local-install | |
--no-verify | |
--site "%CYGWIN_MIRROR%" | |
--local-package-dir "%CYGWIN_ROOT%" | |
--root "%CYGWIN_ROOT%" | |
--packages "%CYGWIN_PACKAGES%" | |
shell: cmd | |
- name: Workaround for repo permissions mixup (https://stackoverflow.com/questions/7184941) | |
shell: D:\cygwin\bin\bash.exe "{0}" | |
run: | | |
set -v | |
export PATH=/bin | |
set -euo pipefail | |
chown $(id -u):$(id -g) . | |
mkdir -p "$HOME" | |
touch "$HOME/.gitconfig" | |
git config --global --add safe.directory "$PWD" | |
- name: Run automated tests | |
shell: D:\cygwin\bin\bash.exe "{0}" | |
run: | | |
export PATH=/bin | |
make -C tests test-verbose | |
env: | |
TEST_SUBPROCESS_TIMEOUT: 300 | |
- name: Failure diagnostics | |
run: | | |
find "$CYGWIN_ROOT" -type f | |
env | |
shell: bash | |
if: failure() |