Skip to content

Commit

Permalink
Merge pull request #524 from avcopan/dev
Browse files Browse the repository at this point in the history
Adds Action steps to deploy docs on GH pages
  • Loading branch information
avcopan authored Jul 9, 2024
2 parents a06ea7e + 1a46a47 commit e699ff7
Show file tree
Hide file tree
Showing 5 changed files with 100 additions and 17 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: docs

on:
push:
pull_request:
workflow_dispatch:

jobs:
docs:
runs-on: ubuntu-latest
strategy:
fail-fast: false

steps:
# Repository
- name: Checkout the code
uses: actions/checkout@v4

# Environment
- name: Download environment files
run: |
wget https://raw.githubusercontent.com/Auto-Mech/amech-dev/main/pixi.toml
wget https://raw.githubusercontent.com/Auto-Mech/amech-dev/main/pixi.lock
- name: Set up Pixi
uses: prefix-dev/[email protected]

- name: Pip install
run: |
pixi run pip install . --no-deps
# Docs
- name: Build docs
run: |
cd docs
pixi run make html
- name: Upload docs
uses: actions/upload-artifact@v4
with:
name: html-docs
path: docs/build/html/

- name: Deploy docs
uses: peaceiris/actions-gh-pages@v4
if: github.ref == 'refs/heads/dev'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs/build/html
35 changes: 35 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: lint

on:
push:
pull_request:
workflow_dispatch:

jobs:
lint:
runs-on: ubuntu-latest
strategy:
fail-fast: false

steps:
# Repository
- name: Checkout the code
uses: actions/checkout@v4

# Environment
- name: Download environment files
run: |
wget https://raw.githubusercontent.com/Auto-Mech/amech-dev/main/pixi.toml
wget https://raw.githubusercontent.com/Auto-Mech/amech-dev/main/pixi.lock
- name: Set up Pixi
uses: prefix-dev/[email protected]

- name: Pip install
run: |
pixi run pip install . --no-deps
# Lint
- name: Lint
run: |
pixi run ./old-lint.sh
14 changes: 3 additions & 11 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,17 @@ on:
workflow_dispatch:

jobs:
# Run tests
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false

steps:
# Repository
- name: Checkout the code
uses: actions/checkout@v4

# Environment
- name: Download environment files
run: |
wget https://raw.githubusercontent.com/Auto-Mech/amech-dev/main/pixi.toml
Expand All @@ -28,16 +29,7 @@ jobs:
run: |
pixi run pip install . --no-deps
- name: Lint (new)
run: |
pixi run ./lint.sh
- name: Lint (old)
run: |
pixi run pylint --rcfile=.pylintrc automol
pixi run pylint --rcfile=.pylintrc phydat
pixi run pylint --rcfile=.pylintrc autoreact
# Test
- name: Test
run: |
pixi run pytest -v automol -v automol --ignore=automol/tests/test_convert.py
Expand Down
6 changes: 0 additions & 6 deletions lint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,7 @@ FILES=(

(
cd $SCRIPT_DIR
echo "New linting:"
pre-commit run black --files ${FILES[@]}
pre-commit run ruff --files ${FILES[@]}
pre-commit run mypy --files ${FILES[@]}

echo "Old linting:"
pylint --rcfile=.pylintrc automol
pylint --rcfile=.pylintrc phydat
pylint --rcfile=.pylintrc autoreact
)
13 changes: 13 additions & 0 deletions old-lint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env bash
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )

(
cd $SCRIPT_DIR
echo "New linting:"
bash ./lint.sh

echo "Old linting:"
pylint --rcfile=.pylintrc automol
pylint --rcfile=.pylintrc phydat
pylint --rcfile=.pylintrc autoreact
)

0 comments on commit e699ff7

Please sign in to comment.