Skip to content

Commit

Permalink
Update workflows for poetry
Browse files Browse the repository at this point in the history
  • Loading branch information
ElliottKasoar committed Feb 5, 2024
1 parent 899221d commit 1769de9
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 30 deletions.
55 changes: 34 additions & 21 deletions .github/workflows/ci_orig.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,54 +32,67 @@ jobs:
- 5672:5672

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Install poetry
run: pipx install poetry

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'poetry'

- name: Install python dependencies
run: |
pip install --upgrade pip
pip install -e .[testing]
poetry install --with dev
- name: Run test suite
env:
# show timings of tests
PYTEST_ADDOPTS: "--durations=0"
run: pytest --cov aiida_mlip --cov-append .
run: poetry run pytest --cov aiida_mlip --cov-append .

docs:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.11
uses: actions/setup-python@v2
- uses: actions/checkout@v4

- name: Install poetry
run: pipx install poetry

- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: 3.11
python-version: 3.12
cache: 'poetry'

- name: Install python dependencies
run: |
pip install --upgrade pip
pip install -e .[docs]
poetry install --only docs
- name: Build docs
run: cd docs && make
run: cd docs && poetry run make

pre-commit:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.11
uses: actions/setup-python@v2
- uses: actions/checkout@v4

- name: Install poetry
run: pipx install poetry

- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: "3.11"
python-version: "3.12"
cache: 'poetry'

- name: Install python dependencies
run: |
pip install --upgrade pip
pip install -e .[pre-commit,docs,testing]
run: poetry install --with pre-commit,docs,dev

- name: Run pre-commit
run: |
pre-commit install
pre-commit run --all-files || ( git status --short ; git diff ; exit 1 )
poetry run pre-commit install
poetry run pre-commit run --all-files || ( git status --short ; git diff ; exit 1 )
22 changes: 13 additions & 9 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: aiida-mlip documentation publish

on:
push:
branches: [main]
pull_request:
branches: [main]
on: [push, pull_request]
# push:
# branches: [main]
# pull_request:
# branches: [main]

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
Expand All @@ -27,19 +27,23 @@ jobs:
container: sphinxdoc/sphinx

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install poetry
run: pipx install poetry

- name: sphinx
run: |
pip install sphinxcontrib-contentui furo aiida-core
# temp fix install the package
python -m pip install .
poetry install --only docs
cd docs
make html
- name: upload
uses: actions/upload-pages-artifact@v1
with:
# Upload entire repository
path: './docs/build/html/.'

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1

0 comments on commit 1769de9

Please sign in to comment.