Skip to content

Commit

Permalink
Add testing CI and fix docs
Browse files Browse the repository at this point in the history
  • Loading branch information
coretl committed Jan 24, 2024
1 parent 431c71e commit e70015a
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
run: python .github/pages/make_switcher.py --add $DOCS_VERSION ${{ github.repository }} build/switcher.json

- name: Publish Docs to gh-pages
if: github.event_name == 'push' && github.actor != 'dependabot[bot]'
if: github.ref_type == 'tag' || github.ref_name == 'main'
# We pin to the SHA, not the tag, for security reasons.
# https://docs.github.com/en/actions/learn-github-actions/security-hardening-for-github-actions#using-third-party-actions
uses: peaceiris/actions-gh-pages@bd8c6b06eba6b3d25d72b7a1767993c0aeee42e7 # v3.9.2
Expand Down
27 changes: 27 additions & 0 deletions .github/workflows/_tox.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
on:
workflow_call:
inputs:
tox:
type: string
description: What to run under tox
required: true


jobs:
run:
runs-on: "ubuntu-latest"

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup python
uses: actions/setup-python@v5
with:
python-version: "3.11"

- name: Install python packages
run: pip install -c dev-requirements.txt -e .[dev]

- name: Run tox
run: tox -e ${{ inputs.tox }}
10 changes: 9 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,20 @@ jobs:
# TODO: Use the CI straight from the template
uses: ./.github/workflows/_check.yml

# TODO: add pre-commit and ctt
# TODO: Use the CI straight from the template
test:
needs: check
if: ${{ ! needs.check.outputs.branch-pr }}
uses: ./.github/workflows/_tox.yml
with:
tox: pre-commit,test

docs:
needs: check
if: ${{ ! needs.check.outputs.branch-pr }}
uses: ./.github/workflows/_docs.yml
permissions:
contents: write

release:
if: github.ref_type == 'tag'
Expand Down

0 comments on commit e70015a

Please sign in to comment.