Skip to content

Commit

Permalink
Improve Github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
kewisch committed Apr 4, 2024
1 parent 16dda7f commit 8f90f83
Show file tree
Hide file tree
Showing 3 changed files with 90 additions and 12 deletions.
74 changes: 62 additions & 12 deletions .github/workflows/checkin.yml
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ build/
webpack-build-config.json
url_map.json
node_modules/
.tox
27 changes: 27 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 8f90f83

Please sign in to comment.