From 6e1d35a85a11f73b6cb668a3aa8b864a5e5bb3ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89loi=20Rivard?= Date: Fri, 8 Dec 2023 17:23:56 +0100 Subject: [PATCH] chore: use GHA to test python versions and build documentation --- .github/workflows/Check_local_run.yml | 10 +++++++- .github/workflows/Documentation.yml | 37 +++++++++++++++++++++++++++ .github/workflows/Test_coverage.yml | 6 ++--- 3 files changed, 49 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/Documentation.yml diff --git a/.github/workflows/Check_local_run.yml b/.github/workflows/Check_local_run.yml index 457f1e8a..533a7cc9 100644 --- a/.github/workflows/Check_local_run.yml +++ b/.github/workflows/Check_local_run.yml @@ -24,6 +24,14 @@ jobs: test-local: name: Run test locally runs-on: ubuntu-latest + strategy: + matrix: + python: + - '3.11' + - '3.10' + - '3.9' + - '3.8' + steps: - name: Setup git uses: actions/checkout@v3 @@ -31,7 +39,7 @@ jobs: - name: Setup python uses: actions/setup-python@v4 with: - python-version: 3.9 + python-version: ${{ matrix.python }} - name: Install python dependencies run: | diff --git a/.github/workflows/Documentation.yml b/.github/workflows/Documentation.yml new file mode 100644 index 00000000..f1157cd1 --- /dev/null +++ b/.github/workflows/Documentation.yml @@ -0,0 +1,37 @@ +--- +name: Documentation +on: + push: + branches: + - production + - main + pull_request: + branches: + - production + - main +jobs: + tests: + name: ${{ matrix.python }} + runs-on: ubuntu-latest + strategy: + fail-fast: false + + steps: + - uses: actions/checkout@v3 + + - uses: actions/setup-python@v4 + with: + python-version: 3.11 + + - uses: actions/cache@v1 + with: + path: ~/.cache/pip + key: pip|${{ hashFiles('web/requirements.doc.txt') }} + + - name: Install python dependencies + run: | + python -m pip install --upgrade pip + pip install -r web/requirements.doc.txt + + - name: Run unit tests + run: sphinx-build documentation build/sphinx/html diff --git a/.github/workflows/Test_coverage.yml b/.github/workflows/Test_coverage.yml index d9cca6ff..988630a3 100644 --- a/.github/workflows/Test_coverage.yml +++ b/.github/workflows/Test_coverage.yml @@ -3,11 +3,11 @@ name: Check coverage on: pull_request: branches: - - master + - production - main push: branches: - - master + - production - main jobs: @@ -21,7 +21,7 @@ jobs: - name: Setup python uses: actions/setup-python@v4 with: - python-version: 3.9 + python-version: 3.11 - name: Switch to main branch uses: actions/checkout@v3