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 dfdd6d7 commit 4df5c75
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 27 deletions.
53 changes: 31 additions & 22 deletions .github/workflows/ci_orig.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,54 +32,63 @@ 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 }}

- 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

- name: Install python dependencies
run: |
pip install --upgrade pip
pip install -e .[docs]
run: poetry install --with 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"

- 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 )
19 changes: 14 additions & 5 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,28 @@ jobs:
container: sphinxdoc/sphinx

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

- name: Install poetry
run: |
apt update
apt upgrade -y
apt install -y pipx
pipx install poetry
- name: sphinx
run: |
pip install sphinxcontrib-contentui furo aiida-core
# temp fix install the package
python -m pip install .
export PATH="$HOME/.local/bin:$PATH"
poetry install --with docs
cd docs
make html
poetry run 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 4df5c75

Please sign in to comment.