Skip to content

Commit

Permalink
Setup CI
Browse files Browse the repository at this point in the history
  • Loading branch information
Luthaf committed Jul 17, 2024
1 parent 6a6ad14 commit c7ccafc
Show file tree
Hide file tree
Showing 2 changed files with 95 additions and 0 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Documentation

on:
push:
branches: [main]
tags: ["*"]
pull_request:
# Check all PR

jobs:
build-and-publish:
permissions:
contents: write
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4

- name: setup Python
uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: install dependencies
run: |
python -m pip install tox
- name: build documentation
run: tox -e docs

- name: put documentation in the website
run: |
git clone https://github.com/$GITHUB_REPOSITORY --branch gh-pages gh-pages
rm -rf gh-pages/.git
cd gh-pages
REF_KIND=$(echo $GITHUB_REF | cut -d / -f2)
if [[ "$REF_KIND" == "tags" ]]; then
TAG=${GITHUB_REF#refs/tags/}
mv ../docs/build/html $TAG
else
rm -rf latest
mv ../docs/build/html latest
fi
- name: deploy to gh-pages
if: github.event_name == 'push'
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./gh-pages/
force_orphan: true
44 changes: 44 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Tests

on:
push:
branches: [main]
pull_request:
# Check all PR

concurrency:
group: tests-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}

jobs:
tests:
runs-on: ${{ matrix.os }}
name: ${{ matrix.os }} / Python ${{ matrix.python-version }}
strategy:
matrix:
include:
- os: ubuntu-20.04
python-version: "3.9"
- os: ubuntu-20.04
python-version: "3.12"
- os: macos-14
python-version: "3.12"
- os: windows-2019
python-version: "3.12"
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: install tests dependencies
run: |
python -m pip install --upgrade pip
python -m pip install tox
- name: run tests
run: tox

0 comments on commit c7ccafc

Please sign in to comment.