Add requirements-dev.txt file with pytest #51
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This workflow will install Python dependencies, run tests and lint with a single version of Python | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | |
name: GPG Website Build | |
on: | |
push: | |
branches: | |
- '*' | |
pull_request: | |
branches: [ main ] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python 3.9 | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.9 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install flake8 pytest | |
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | |
- name: Test with pytest | |
run: | | |
pytest -s -v tests | |
deploy: | |
runs-on: ubuntu-latest | |
needs: test | |
if: github.ref == 'refs/heads/main' | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python 3.9 | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.9 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
- name: Build pages | |
run: | | |
make html | |
- name: GitHub Pages | |
# You may pin to the exact commit or the version. | |
# uses: crazy-max/ghaction-github-pages@db4476a01402e1a7ce05f41832040eef16d14925 | |
uses: crazy-max/ghaction-github-pages@v2.5.0 | |
with: | |
# Git domain (default github.com) | |
# domain: # optional, default is github.com | |
# GitHub repository where assets will be deployed (default $GITHUB_REPOSITORY) | |
# repo: # optional | |
# Git branch where assets will be deployed | |
# target_branch: # optional, default is gh-pages | |
# Create incremental commit instead of doing push force | |
# keep_history: # optional, default is false | |
# Allow an empty commit to be created | |
# allow_empty_commit: # optional, default is true | |
# Build directory to deploy | |
build_dir: _build/html | |
# The committer name and email address | |
# committer: # optional | |
# The author name and email address | |
# author: # optional | |
# Commit message | |
# commit_message: # optional | |
# Write the given domain name to the CNAME file | |
fqdn: gpg.geosci.xyz | |
# Allow Jekyll to build your site | |
jekyll: false # optional, default is true | |
# If enabled, nothing will be pushed | |
# dry_run: true # optional, default is false | |
# Enable verbose output | |
# verbose: true # optional, default is false | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |