diff --git a/.github/workflows/checkin.yml b/.github/workflows/checkin.yml index c065105..a707acb 100644 --- a/.github/workflows/checkin.yml +++ b/.github/workflows/checkin.yml @@ -1,26 +1,76 @@ name: Checkin -on: - push: - branches: - - main - pull_request: +on: push + +permissions: + contents: write jobs: - lint: + build-indico-plugin: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 - - name: Setup Python - uses: actions/setup-python@v4 - - name: Install dependencies + uses: actions/checkout@v4 + with: + path: plugin + + - name: Clone indico + run: | + git clone https://github.com/indico/indico.git indico-src \ + --depth 1 --branch master + + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: npm + cache-dependency-path: indico-src/package-lock.json + + - name: Setup apt packages run: | - python -m pip install --upgrade pip - python -m pip install tox + sudo apt install -y --install-recommends libxslt1-dev libxml2-dev libffi-dev libpcre3-dev \ + libyaml-dev build-essential libpq-dev libpango1.0-dev + sudo apt install -y libjpeg-turbo8-dev zlib1g-dev + + - name: npm ci plugin + working-directory: ./plugin + run: npm ci + + - name: npm ci indico + working-directory: ./indico-src + run: npm ci + + - name: Setup python + uses: actions/setup-python@v5 + with: + python-version: '3.12' + cache: pip + + - name: pip plugin + working-directory: ./plugin + run: pip install -e '.[dev]' + - name: Tox + working-directory: ./plugin run: python -m tox + - name: pip indico + working-directory: ./indico-src + run: pip install -e '.[dev]' + - name: Build wheel + working-directory: ./indico-src + run: ./bin/maintenance/build-wheel.py plugin ../plugin + - name: Upload Wheel + uses: actions/upload-artifact@v4 + with: + name: wheel + path: indico-src/dist/*.whl + - name: Release + if: startsWith(github.ref, 'refs/tags/') + uses: softprops/action-gh-release@v2 + with: + fail_on_unmatched_files: true + files: indico-src/dist/*.whl diff --git a/.gitignore b/.gitignore index d416c1e..d68aa97 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ build/ webpack-build-config.json url_map.json node_modules/ +.tox diff --git a/setup.cfg b/setup.cfg index 257bc9f..646882c 100644 --- a/setup.cfg +++ b/setup.cfg @@ -19,9 +19,36 @@ python_requires = >=3.9.0, <3.13 install_requires = indico>=3.0 +[options.extras_require] +dev = tox==4.14.2 + + [options.entry_points] indico.plugins = countdown = indico_countdown_plugin.plugin:CountdownPlugin [pydocstyle] ignore = D100,D101,D102,D103,D104,D105,D107,D203,D213 + +[flake8] +ignore = E203, E266, E501, W503 +max-line-length = 88 +max-complexity = 18 +select = B,C,E,F,W,T4 + +[tox:tox] +envlist = py3 + +[isort] +profile = black + +[testenv] +allowlist_externals = npx +deps = + black + isort + flake8 +commands = + black indico_countdown_plugin + isort indico_countdown_plugin + flake8 indico_countdown_plugin