41 lines
1,008 B
YAML
41 lines
1,008 B
YAML
|
|
name: ci
|
||
|
|
|
||
|
|
on:
|
||
|
|
push:
|
||
|
|
branches: [main]
|
||
|
|
pull_request:
|
||
|
|
branches: [main]
|
||
|
|
workflow_dispatch:
|
||
|
|
|
||
|
|
jobs:
|
||
|
|
test:
|
||
|
|
runs-on: ubuntu-latest
|
||
|
|
steps:
|
||
|
|
- name: Fetch source archive
|
||
|
|
env:
|
||
|
|
REF: ${{ github.sha }}
|
||
|
|
run: |
|
||
|
|
set -eu
|
||
|
|
mkdir -p repo
|
||
|
|
wget -qO /tmp/repo.tar.gz \
|
||
|
|
"https://forgejo.coulomb.social/${GITHUB_REPOSITORY}/archive/${REF}.tar.gz"
|
||
|
|
tar xzf /tmp/repo.tar.gz -C repo --strip-components=1
|
||
|
|
|
||
|
|
- name: Install package and dev tools
|
||
|
|
working-directory: repo
|
||
|
|
run: |
|
||
|
|
python3 -m pip install --upgrade pip
|
||
|
|
python3 -m pip install -e ".[dev]"
|
||
|
|
|
||
|
|
- name: Format check (black)
|
||
|
|
working-directory: repo
|
||
|
|
run: black --check src tests
|
||
|
|
|
||
|
|
- name: Lint (flake8)
|
||
|
|
working-directory: repo
|
||
|
|
run: flake8 src/ --max-line-length=100
|
||
|
|
|
||
|
|
- name: Run tests
|
||
|
|
working-directory: repo
|
||
|
|
run: pytest tests/ -q --ignore=tests/test_cli_error_handling.py
|