Files
RecordFlux-parser/.github/workflows/tests.yml
2022-09-06 11:29:40 +02:00

112 lines
3.1 KiB
YAML

name: tests
on:
push:
schedule:
- cron: '0 2 * * *'
jobs:
checks:
name: Checks
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
target:
- black
- isort
- flake8
- pylint
- mypy
- pydocstyle
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.8"
- name: Determine exact Python version
run:
echo "PYTHON_VERSION=$(python -c 'import platform; print(platform.python_version())')" >> $GITHUB_ENV
- name: Cache Python dependencies
uses: actions/cache@v2
with:
path: |
~/.cache/pip
~/.local/lib/python${{ matrix.python-version }}/site-packages
~/.local/bin
key: ${{ runner.os }}-python${{ env.PYTHON_VERSION }}-${{ hashFiles('requirements.txt', 'disttools/setup.py', '.config/python-style/setup.cfg') }}
- name: Install GNAT Community
uses: ada-actions/toolchain@ce2020
with:
distrib: community
- name: Install dependencies
run: |
echo "$HOME/.local/bin" >> $GITHUB_PATH
echo "PYTHONPATH=$PWD" >> $GITHUB_ENV
sudo apt install libgmp-dev
make install_devel
- name: Check
run: |
make check_${{ matrix.target }}
tests:
name: Tests
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
python-version:
- "3.8"
- "3.9"
- "3.10"
gnat-distrib:
- community
- fsf
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Determine exact Python version
run:
echo "PYTHON_VERSION=$(python -c 'import platform; print(platform.python_version())')" >> $GITHUB_ENV
- name: Cache Python dependencies
uses: actions/cache@v2
with:
path: |
~/.cache/pip
~/.local/lib/python${{ matrix.python-version }}/site-packages
~/.local/bin
key: ${{ runner.os }}-python${{ env.PYTHON_VERSION }}-${{ hashFiles('requirements.txt', 'disttools/setup.py', '.config/python-style/setup.cfg') }}
- name: Install GNAT Community
if: ${{ matrix.gnat-distrib == 'community' }}
uses: ada-actions/toolchain@ce2020
with:
distrib: community
- name: Install Alire
if: ${{ matrix.gnat-distrib == 'fsf' }}
uses: alire-project/setup-alire@v1
with:
version: "1.2.0"
- name: Install FSF GNAT
if: ${{ matrix.gnat-distrib == 'fsf' }}
run: |
make install_gnat
- name: Install dependencies
run: |
echo "$HOME/.local/bin" >> $GITHUB_PATH
echo "PYTHONPATH=$PWD" >> $GITHUB_ENV
sudo apt install libgmp-dev
eval `make printenv_gnat`
make install_devel
- name: Test
run: |
eval `make printenv_gnat`
make test