-
Notifications
You must be signed in to change notification settings - Fork 187
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Documentation with Github Actions #172
Conversation
Problems -
|
name: Test | ||
|
||
on: | ||
push: | ||
branches: [master] | ||
pull_request: | ||
branches: [master] | ||
|
||
jobs: | ||
test: | ||
name: ${{ matrix.os }}, py-${{ matrix.python-version }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-18.04, windows-latest, macOS-latest] | ||
python-version: ["3.6", "3.7", "3.8", "3.9"] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Setup Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- uses: pre-commit/[email protected] | ||
- name: Install dependencies | ||
shell: bash | ||
run: | | ||
python -m pip install --upgrade pip poetry wheel | ||
poetry config virtualenvs.create false | ||
poetry install | ||
- name: Run tests | ||
shell: bash | ||
run: | | ||
python -m unittest moabb.tests | ||
- name: Run pipelines | ||
shell: bash | ||
run: | | ||
python -m moabb.run --pipelines=./moabb/tests/test_pipelines/ --verbose |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why delete this?
push: | ||
branches: [master] | ||
pull_request: | ||
branches: [master] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Docs should be built but not deployed on PRs.
matplotlib | ||
sphinx_bootstrap_theme | ||
git | ||
git+https://github.com/NeuroTechX/moabb |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These dependencies are already in pyproject.toml
, why keep a separate requirements.txt
?
- name: Commit documentation changes | ||
run: | | ||
git clone https://github.com/NeuroTechX/moabb.github.io.git --branch master --single-branch master | ||
cp -r docs/_build/html/* master/ | ||
cd master | ||
touch .nojekyll | ||
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" | ||
git config --global user.name "github-actions[bot]" | ||
git add . | ||
git commit -m "Update documentation" -a || true | ||
# The above command will fail if no changes were present, so we ignore | ||
# that. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are good actions for this (to avoid the mess), see for example: NeuroTechX/EEG-ExPy#62
Deploy should also only happen on master branch, see: https://github.com/NeuroTechX/eeg-notebooks/pull/62/files#r540869378
- name: Commit documentation changes | |
run: | | |
git clone https://github.com/NeuroTechX/moabb.github.io.git --branch master --single-branch master | |
cp -r docs/_build/html/* master/ | |
cd master | |
touch .nojekyll | |
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
git config --global user.name "github-actions[bot]" | |
git add . | |
git commit -m "Update documentation" -a || true | |
# The above command will fail if no changes were present, so we ignore | |
# that. | |
- name: Deploy | |
uses: peaceiris/actions-gh-pages@v3 | |
if: github.ref == 'refs/heads/master' | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: docs/_build/html |
This does the part of building the docs and committing to moabb.github.io repo from where the GH page works. Pushing not yet done.
Closes #78