Skip to content

Commit

Permalink
split workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
JessyBarrette committed Aug 15, 2023
1 parent b211e25 commit 784d8eb
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 32 deletions.
Original file line number Diff line number Diff line change
@@ -1,41 +1,13 @@
name: Test linter, full pytest and generate docs on push

on:
pull_request:
branches:
- main
- development
push:
branches:
- main
- development

jobs:
testing:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.10']
steps:
- uses: actions/checkout@v3
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .[dev]
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest parsers
run: pytest -W error::UserWarning
- name: Run benchmark
run: pytest tests/run_benchmark.py --benchmark-json output.json

deploy_docs:
needs: testing
if: github.event_name == 'push'
environment:
name: ${{github.ref_name}}
url: ${{ github.ref == 'main' && 'https://cioos-siooc.github.io/ocean-data-parser/main/' || 'https://cioos-siooc.github.io/ocean-data-parser/dev/' }}
Expand All @@ -54,10 +26,6 @@ jobs:
mkdocs-material-
- run: pip install . |
pip install -r docs-requirements.txt
<<<<<<< HEAD

=======
>>>>>>> cli-docs
- run: |
git config --global user.name "${GITHUB_ACTOR}"
git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com"
Expand Down
30 changes: 30 additions & 0 deletions .github/workflows/test-docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Test docs generation

on:
pull_request:
branches:
- main
- development


test_docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: 3.x
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
- uses: actions/cache@v3
with:
key: mkdocs-material-${{ env.cache_id }}
path: .cache
restore-keys: |
mkdocs-material-
- run: pip install . |
pip install -r docs-requirements.txt
- run: |
git config --global user.name "${GITHUB_ACTOR}"
git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com"
- run: |
mike deploy test
34 changes: 34 additions & 0 deletions .github/workflows/test-pytest.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Test linter and full pytest

on:
pull_request:
branches:
- main
- development
push:
branches:
- main
- development

jobs:
testing:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.10']
steps:
- uses: actions/checkout@v3
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .[dev]
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest parsers
run: pytest -W error::UserWarning
- name: Run benchmark
run: pytest tests/run_benchmark.py --benchmark-json output.json

0 comments on commit 784d8eb

Please sign in to comment.