127 lines
4.2 KiB
YAML
127 lines
4.2 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [main, opensuse]
|
|
pull_request:
|
|
branches: [main, opensuse]
|
|
|
|
jobs:
|
|
CI:
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
matrix:
|
|
build-type: ['normal']
|
|
container:
|
|
- 'registry.fedoraproject.org/fedora:latest'
|
|
- 'registry.fedoraproject.org/fedora:rawhide'
|
|
- 'registry.opensuse.org/opensuse/tumbleweed:latest'
|
|
include:
|
|
- container: 'registry.fedoraproject.org/fedora:latest'
|
|
build-type: 'no-optional-deps'
|
|
- container: 'registry.opensuse.org/opensuse/tumbleweed:latest'
|
|
build-type: 'no-optional-deps'
|
|
fail-fast: false
|
|
|
|
container:
|
|
image: ${{ matrix.container }}
|
|
|
|
steps:
|
|
- run: zypper -n install
|
|
cpio gzip
|
|
bzip2 xz
|
|
binutils glibc glibc-32bit glibc-locale
|
|
python3-python-magic
|
|
python3-rpm
|
|
python3-base
|
|
python3-setuptools
|
|
python3-pybeam
|
|
python3-pytest
|
|
python3-pytest-cov
|
|
python3-pytest-xdist
|
|
python3-flake8
|
|
python3-flake8-builtins
|
|
python3-flake8-bugbear
|
|
python3-flake8-import-order
|
|
python3-flake8-quotes
|
|
python3-pyxdg
|
|
python3-zstandard
|
|
python3-tomli
|
|
python3-tomli-w
|
|
python3-pip
|
|
python3-pipx
|
|
rpm-build
|
|
git
|
|
if: ${{ contains(matrix.container, 'opensuse') }}
|
|
- run: zypper -n install
|
|
checkbashisms dash
|
|
desktop-file-utils
|
|
appstream-glib
|
|
myspell-en_US myspell-cs_CZ
|
|
myspell-fr_FR
|
|
python3-pyenchant
|
|
if: ${{ contains(matrix.container, 'opensuse') && matrix.build-type == 'normal' }}
|
|
- run: zypper -n install python3-flake8-comprehensions
|
|
if: ${{ contains(matrix.container, 'opensuse') }}
|
|
- run: dnf --nogpgcheck --assumeyes install
|
|
/usr/bin/cpio
|
|
/usr/bin/bzip2
|
|
/usr/bin/python3
|
|
/usr/bin/readelf
|
|
/usr/bin/ldd
|
|
/usr/bin/c++filt
|
|
/usr/bin/xz
|
|
glibc
|
|
glibc.i686
|
|
python3-setuptools
|
|
python3-magic
|
|
python3-rpm
|
|
python3-pybeam
|
|
python3-pytest
|
|
python3-pytest-cov
|
|
python3-pytest-xdist
|
|
python3-flake8
|
|
python3-flake8-builtins
|
|
python3-flake8-import-order
|
|
python3-flake8-quotes
|
|
python3-pyxdg
|
|
python3-tomli-w
|
|
python3-zstandard
|
|
python3-pip
|
|
pipx
|
|
rpm-build
|
|
git
|
|
if: ${{ contains(matrix.container, 'fedora') }}
|
|
- run: dnf --assumeyes install
|
|
python3-tomli
|
|
if: ${{ contains(matrix.container, 'fedora') && ! contains(matrix.container, 'rawhide') }}
|
|
- run: dnf --nogpgcheck --assumeyes install
|
|
/usr/bin/appstream-util
|
|
/usr/bin/desktop-file-validate
|
|
dash
|
|
devscripts-checkbashisms
|
|
hunspell-en
|
|
hunspell-cs
|
|
hunspell-fr
|
|
python3-enchant
|
|
if: ${{ contains(matrix.container, 'fedora') && matrix.build-type == 'normal' }}
|
|
- run: rm -rf $(rpm --eval '%_dbpath')
|
|
if: matrix.build-type == 'no-optional-deps'
|
|
- run: pipx install coveralls
|
|
- run: pipx install pyupgrade
|
|
- run: pipx install ruff
|
|
- uses: actions/checkout@v3
|
|
- run: pytest
|
|
- run: flake8
|
|
- run: /github/home/.local/bin/ruff check .
|
|
- run: find . -not -path "./test/files/*" -name '*.py' | xargs /github/home/.local/bin/pyupgrade --py38-plus
|
|
- run: python3 -m cProfile -o profile.stats lint.py -V test/source/* test/binary/* > /dev/null
|
|
- run: python3 test/dump_stats.py profile.stats
|
|
- name: Collect the coveralls report
|
|
env:
|
|
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
run: /github/home/.local/bin/coveralls
|
|
if: github.event_name != 'pull_request'
|